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
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.

FrequencyGroup Class

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

This class provides time spreading of the periodic function calls.

The FrequencyGroup class implementation can be found in the data/framework/game/scheduler.h file.

FrequencyGroup Class

Members


int getFrequency()

Returns a call frequency of the functions in the frequency group.

Return value

Call frequency.

int getNumTasks()

Returns the number of function callbacks.

Return value

Number of of function callbacks.

GameCallback getTask(int i)

Returns a callback from the frequency group by its index.

Arguments

  • int i - Callback index.

Return value

Game callback.

void appendTask(GameCallback task)

Appends a new callback to a frequency group for time spreading.

Arguments

  • GameCallback task - Callback to append.

GameCallback find(string key)

Searches a callback in the frequency group by using a unique key.

Arguments

  • string key - Unique key.

Return value

Game callback.

FrequencyGroup(int frequency, int base_frequency)

Constructor. Creates a new FrequencyGroup class instance with the certain number of ticks.

Arguments

  • int frequency - Group frequency.
  • int base_frequency - The maximum frequency of the scheduler system.

void update(GameCallback tasks[], int sort[])

Collects functions, which are called in the current tick (1/60 seconds).

Arguments

  • GameCallback tasks[] - Array of the functions.
  • int sort[] - Priorities of the functions.
Last update: 2017-07-03
Build: ()