Programming
Fundamentials
Setting Up Development Environment
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes

Field Class

Describes the Field methods of the Entity.

The Field class implementation can found in the data/framework/game/fields.h file.

Field Class

Members


Field (variable instance)

Constructor. Creates a new Field class instance.

Arguments

  • variable instance - A user class instance with fields methods or a user class name.

int getSetterId ()

Returns a setter function ID.

Return value

ID of the setter function.

void setSetter (string func_name)

Sets a setter function.

Arguments

  • string func_name - Setter function name.

int getGetterId ()

Returns a getter function ID.

Return value

ID of the getter function.

void setGetter (string func_name)

Sets a getter function.

Arguments

  • string func_name - Getter function name.

string getGetterName ()

Returns a getter function name.

Return value

Getter function name.

string getSetterName ()

Returns a setter function name.

Return value

Setter function name.

string getName ()

Returns a field name.

Return value

Field name.

void setName (string name)

Sets a field name.

Arguments

  • string name - Field name.

int getType ()

Returns one of the FIELD_* types.

Return value

Field type.

void setType (int type)

Sets one of the FIELD_* types.

Arguments

  • int type - Field type.

string getClassName ()

Returns a field class name.

Return value

Field class name.

void setClassName (string name)

Sets a field class name.

Arguments

  • string name - Field class name.

int getNumSwitchItems ()

Returns the number of switch items in the Field.

Return value

Number of switch items. If the field type is not FIELD_SWITCH, then function returns 0.

string getSwitchItem (int i)

Returns a switch item name by its number.

Arguments

  • int i - Switch item number.

Return value

Switch item name. If the field type is not FIELD_SWITCH, then function returns an empty string ("").

void setSwitchItems (string items)

Sets switch items for the field.

Arguments

  • string items - Comma-separated switch items.

int getSwitchDefault ()

Returns the default switch value.

Return value

Default switch value.

void setSwitchDefault (int value)

Sets the default switch value.

Arguments

  • int value - Default switch value.

int FIELD_INT

Description

Integer field type.

int FIELD_FLOAT

Description

Float field type.

int FIELD_DOUBLE

Description

Double field type.

int FIELD_STRING

Description

String field type.

int FIELD_VEC3

Description

Vec3 field type.

int FIELD_VEC4

Description

Vec4 field type.

int FIELD_COLOR

Description

Color field type.

int FIELD_SWITCH

Description

Switch field type.

int FIELD_TOGGLE

Description

Toggle field type.
Last update: 2017-07-03