FrequencyGroup Class
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
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)