This page has been translated automatically.
Программирование
Fundamentals
Setting Up Development Environment
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

LevelData Class

Warning
Game Framework is deprecated and no longer supported. We can't guarantee the stable work of the framework.

Provides an access to data of the game level.

The LevelData class implementation can be found in the data/framework/game/game_data.h file.

LevelData Class

Members


void setDescription (string description)

Sets a level description.

Arguments

  • string description - Level description.

string getDescription()

Returns a level description.

Return value

Level description.

GameData getGameData()

Returns an instance of the GameData class, to which a level belongs to.

Return value

GameData class instance.

void setLevelFile(string path)

Sets a relative path to the level file.

Arguments

  • string path - Relative path to the level file.

string getLevelFile(int is_absolute = false)

Returns a path to the *.level file relative todata_path.

Arguments

  • int is_absolute - Flag indicating if an absolute file path is returned. 1 to return an absolute file path; otherwise 0.

Return value

Path to the *.level file.

void setLogicClass(string name)

Sets a name of the level logic class.

Arguments

  • string name - Name of the logic class.

string getLogicClass()

Returns a name of the level logic class.

Return value

Name of the level logic class.

void setLogicFile(string path)

Sets a relative path to the logic file of the level.

Arguments

  • string path - Relative path to the *.h file.

string getLogicFile(int is_absolute = false)

Returns a path to the logic file of the level, which is relative to data_path.

Arguments

  • int is_absolute - Flag indicating if an absolute file path is returned. 1 to return an absolute file path; otherwise 0.

Return value

Path to the *.h file.

int setName(string name)

Sets a level name.

Arguments

  • string name - Level name.

Return value

1 if the new name is set successfully; otherwise 0.

string getName()

Returns a level name.

Return value

Level name.

void setWorldFile(string path)

Sets a relative path to the *.world file.

Arguments

  • string path - Relative path to the *.world file.

string getWorldFile(int is_absolute = false)

Returns a path to the *.world file relative todata_path.

Arguments

  • int is_absolute - Flag indicating if an absolute file path is returned. 1 to return an absolute file path; otherwise 0.

Return value

Path to the *.world file.

LevelData(GameData game_data, string name)

Constructor. Creates a new LevelData class instance.

Arguments

  • GameData game_data - Instance of the GameData class, to which the level belongs to.
  • string name - Level name.

int loadData(Xml xml)

Reads level data from the Xml class instance.

Arguments

  • Xml xml - Level data.

Return value

1 if data is loaded successfully; otherwise 0.

void saveData(Xml xml)

Writes level data to the Xml class instance.

Arguments

  • Xml xml - Instance of the Xml class to write data.
Last update: 03.07.2017
Build: ()