This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Properties Class

This set of functions control the loading and managing of properties libraries.

Properties Class

Members


int removeWorldLibrary (string name)

Removes a world library and all its contents.

Arguments

  • string name - Name of the library to remove.

Return value

1 if the library is removed successfully; otherwise, 0.

int getNumLibraries ()

Returns the number of all property libraries not belonging to the current world (for example, loaded by other worlds or with the engine.properties.load() function).

Return value

Number of property libraries not belonging to the world.

int load (string name)

Loads a library from a given file.

Arguments

  • string name - File with the library to load.

Return value

1 if the library is loaded successfully; otherwise, 0.

int findLibrary (string name)

Searches for a library by name.

Arguments

  • string name - Name of the library.

Return value

Index of the library if found; otherwise, -1.

int getNumProperties (int library)

Returns the number of properties in a given library.

Arguments

  • int library - Index of the library.

Return value

Number of properties in the library.

int findPropertyLibrary (string name)

Searches for a library containing a given property.

Arguments

  • string name - Name of the property.

Return value

Index of the library, if found; otherwise, -1.

int moveProperty (string name, string new_library, string new_name)

Moves a property to another library.

Arguments

  • string name - Name of the property to move.
  • string new_library - Destination library, into which the property will be moved.
  • string new_name - Name, under which the property will be added to the destination library.

Return value

1 if the property is moved successfully; otherwise, 0.

Property getProperty (int library, int num)

Returns a property by its index in a given library.

Arguments

  • int library - Index of the library.
  • int num - Index of the property.

Return value

The property.

string getWorldLibraryName (int num)

Returns the name of a library belonging to the current world by its index.

Arguments

  • int num - Index of the library.

Return value

Name of the library.

string getLibraryName (int num)

Returns the name of a library by its index.

Arguments

  • int num - Index of the library.

Return value

Name of the library.

int replaceProperty (string name, string new_name)

Replaces the specified property with a new one.

Arguments

  • string name - Name of property to be replaced.
  • string new_name - Name of the new property.

Return value

1 if the property is replaced successfully; otherwise - 0.

int isProperty (string name)

Checks if there is a property with a given name.

Arguments

  • string name - Name of the property.

Return value

1 if the property exists; otherwise, 0.

Property findProperty (string name)

Searches for a property with a given name.

Arguments

  • string name - Name of the property.

Return value

Property, if found; otherwise, 0.

int getNumWorldLibraries ()

Returns the number of property libraries belonging to the current world.

Return value

Number of libraries belonging to the world.

int isLibrary (string name)

Checks if there is a library with a given name.

Arguments

  • string name - Name of the library.

Return value

1 if the library exists; otherwise, 0.

int addWorldLibrary (string name)

Loads a library and associates it with the current world. If the library file does not exist, an empty library is created.

Arguments

  • string name - File with the library to load.

Return value

1 if the library is loaded or created successfully; otherwise, 0.

int create (string name)

Creates an empty property library.

Arguments

  • string name - Property library name.

Return value

Returns 1 if the library is created successfully; otherwise, 0.

int removeProperty (string name)

Completely removes a property and all its children.

Arguments

  • string name - Name of the property to remove.

Return value

1 if the property is removed successfully; otherwise, 0.

int clear (string name)

Removes a given library and all its contents from a list of property libraries not belonging to the current world. Note that you cannot delete a library, if some of its properties are parent to properties from other libraries.

Arguments

  • string name - Name of the library.

Return value

1 if the library is removed successfully; otherwise, 0.

int cloneProperty (string name, string new_library, string new_name)

Copies a property to another library.

Arguments

  • string name - Name of the property to copy.
  • string new_library - Destination library, into which the property will be copied.
  • string new_name - Name, under which the property will be added to the destination library.

Return value

1 if the property is cloned successfully; otherwise, 0.

int inheritProperty (string name, string new_library, string new_name)

Creates a new property that inherits from a given one and adds it to a specified library.

Arguments

  • string name - Name of the property to inherit from.
  • string new_library - Destination library, into which the inherited property will be added.
  • string new_name - Name, under which the inherited property will be added to the destination library.

Return value

1 if the property is inherited successfully; otherwise, 0.

int isLibraryEditable (int num)

Returns a value indicating if properties can be added to or removed from a given library.

Arguments

  • int num - Index of the library.

Return value

1 if the library is editable; otherwise, 0.

int findLibraryProperty (int library, string name)

Searches for a specific property in a given library.

Arguments

  • int library - Library, in which to search for the property.
  • string name - Name of the property.

Return value

Index of the property in the library, if found; otherwise, -1.

int save (string name)

Saves a library on disk. The name of a file, into which the library will be saved, is the same as the name of the library.

Arguments

  • string name - Name of the library to save.

Return value

1 if the library is saved successfully; otherwise, 0.

string getPropertyName (int library, int num)

Returns the name of a property by its index in a given library.

Arguments

  • int library - Index of the library.
  • int num - Index of the property.

Return value

Name of the property.

void clearWorldLibraries ()

Last update: 2017-07-03
Build: ()