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

FrequencyGroup Class

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


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 appendTask (GameCallback task)

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

Arguments

  • GameCallback task - Callback to append.

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.

int getFrequency ()

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

Return value

Call frequency.

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.

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