This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

LevelData Class

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


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.

string getName ()

Returns a level name.

Return value

Level name.

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 getLevelFile (int is_absolute = false)

Returns a path to the *.level file 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 *.level file.

void setLevelFile (string path)

Sets a relative path to the level file.

Arguments

  • string path - Relative path to the level file.

string getWorldFile (int is_absolute = false)

Returns a path to the *.world file 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 *.world file.

void setWorldFile (string path)

Sets a relative path to the *.world file.

Arguments

  • string path - Relative path to the *.world 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.

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 getLogicClass ()

Returns a name of the level logic class.

Return value

Name of the level logic class.

void setLogicClass (string name)

Sets a name of the level logic class.

Arguments

  • string name - Name of the logic class.

string getDescription ()

Returns a level description.

Return value

Level description.

void setDescription (string description)

Sets a level description.

Arguments

  • string description - Level description.

GameData getGameData ()

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

Return value

GameData class instance.
Last update: 2017-07-03
Build: ()