This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
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
CIGI Client Plugin
Rendering-Related 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.

GameCallback Class

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

This class provides an ability to call functions of the other class.

The GameCallback class implementation can be found in the data/framework/game/game_callback.h file.

GameCallback Class

Members


int isAlive()

Returns a value indicating if a callback can be called.

Return value

1 if a callback can be called; otherwise 0.

Unigine::CallbackBase getCallback()

Returns a callback.

Return value

Callback.

int getFunctionId()

Returns a callback function ID.

Return value

Function ID.

string getFunctionName()

Returns a callback function name.

Return value

Function name.

variable getInstance()

Returns a user class instance, for which a callback is created.

Return value

User class instance. If the callback function is static, then the return value is NULL.

string getKey()

Returns a unique callback identity key.

Return value

Unique identity key.

int getNumArgs()

Returns a number of function arguments.

Return value

Number of function arguments.

int createCallback(variable instance, string function, variable arg0 = 0, variable arg1 = 0, variable arg2 = 0, variable arg3 = 0)

Creates a callback for a class instance.

Arguments

  • variable instance - User class instance, for which the callback function is called. If the callback function is static, then the return value is NULL.
  • string function - Name of the callback function.
  • variable arg0 - Function argument, optional.
  • variable arg1 - Function argument, optional.
  • variable arg2 - Function argument, optional.
  • variable arg3 - Function argument, optional.

Return value

1 if the callback is created successfully; otherwise 0.

int equals(variable instance, string function, int num_args = 0)

Returns a value indicating if a callback meets conditions.

Arguments

  • variable instance - User class instance, for which the function is called. If the callback function is static, then the return value is NULL.
  • string function - Function name.
  • int num_args - Number of function arguments.

Return value

1 if a callback meets conditions; otherwise 0.

int equals(GameCallback c)

Returns a value indicating if callbacks are equal.

Arguments

  • GameCallback c - Second callback to compare with.

Return value

1 if callbacks are equal; otherwise 0.

GameCallback()

Constructor. Creates a new GameCallback class instance.

void run()

Runs a callback function.
Last update: 2017-10-20
Build: ()