#include <system.h>
Collaboration diagram for hoa_system::SystemTimer:

Public Member Functions | |
| void | Initialize (uint32 duration, int32 number_loops=0, hoa_mode_manager::GameMode *mode_owner=NULL) |
| Initializes the critical members of the system timer class. | |
| void | Pause () |
| Pauses the timer if it is running. | |
| void | Reset () |
| Resets the timer to its initial state. | |
| void | Run () |
| Starts the timer from the initial state or resumes it if it is paused. | |
| SystemTimer (uint32 duration, int32 number_loops=0, hoa_mode_manager::GameMode *mode_owner=NULL) | |
| |
| SystemTimer () | |
| ~SystemTimer () | |
Member Get Access Functions | |
| uint32 | GetCurrentLoop () const |
| uint32 | GetDuration () const |
| hoa_mode_manager::GameMode * | GetModeOwner () const |
| int32 | GetNumberLoops () const |
| SYSTEM_TIMER_STATE | GetState () const |
| uint32 | GetTimeExpired () const |
| uint32 | GetTimeLeft () const |
| |
| uint32 | GetTimesCompleted () const |
Timer State Checking Functions | |
| bool | IsFinished () const |
| bool | IsInitial () const |
| bool | IsPaused () const |
| bool | IsRunning () const |
Member Set Access Functions | |
| |
| void | SetDuration (uint32 duration) |
| void | SetModeOwner (hoa_mode_manager::GameMode *mode_owner) |
| void | SetNumberLoops (int32 number_loops) |
Private Member Functions | |
| void | _UpdateTimer () |
| Updates the timer if it is running This method can only be invoked by the GameSystem class. Invoking this method is also the only way in which the timer may arrive at the finished state. | |
Private Attributes | |
| uint32 | _duration |
| The duration (in milliseconds) that the timer should run for. | |
| hoa_mode_manager::GameMode * | _mode_owner |
| A pointer to the game mode object which owns this timer, or NULL if it is unowned. | |
| int32 | _number_loops |
| The number of loops the timer should run for. -1 indicates infinite looping. | |
| SYSTEM_TIMER_STATE | _state |
| Maintains the current state of the timer (initial, running, paused, or finished). | |
| uint32 | _time_expired |
| The amount of time that has expired on the current timer loop (counts up from 0 to _duration). | |
| uint32 | _times_completed |
| Incremented by one each time the timer reaches the finished state. | |
Friends | |
| class | GameSystem |
****************************************************************************
This is a light-weight class for maintaining a simple timer. This class is designed specifically for use by the various game mode classes, but it is certainly capable of being utilized just as effectively by the engine or or other parts of the code. The operation of this class is also integrated with the GameSystem class, which routinely updates and manageds its timers. The features of this timing mechanism include:
It is a recommended practice to create derivative timer objects which inherit from this class. Using SystemTimer as a base class can make it relatively easy to create timers which perform specific functions in the game code, such as temporary displaying damage numbers.
Definition at line 98 of file system.h.
| hoa_system::SystemTimer::SystemTimer | ( | ) |
Definition at line 39 of file system.cpp.
| hoa_system::SystemTimer::SystemTimer | ( | uint32 | duration, | |
| int32 | number_loops = 0, |
|||
| hoa_mode_manager::GameMode * | mode_owner = NULL | |||
| ) | [inline] |
Definition at line 105 of file system.h.
References Initialize().
Here is the call graph for this function:

| hoa_system::SystemTimer::~SystemTimer | ( | ) |
Definition at line 50 of file system.cpp.
References _state, hoa_system::GameSystem::_system_timers, hoa_system::SYSTEM_TIMER_INVALID, and hoa_system::SystemManager.
| void hoa_system::SystemTimer::_UpdateTimer | ( | ) | [private] |
Updates the timer if it is running This method can only be invoked by the GameSystem class. Invoking this method is also the only way in which the timer may arrive at the finished state.
Definition at line 121 of file system.cpp.
References _duration, _number_loops, _state, _time_expired, _times_completed, hoa_system::GameSystem::GetUpdateTime(), IsRunning(), hoa_system::SYSTEM_TIMER_FINISHED, and hoa_system::SystemManager.
Here is the call graph for this function:

| uint32 hoa_system::SystemTimer::GetCurrentLoop | ( | ) | const [inline] |
Definition at line 186 of file system.h.
References _times_completed.
| uint32 hoa_system::SystemTimer::GetDuration | ( | ) | const [inline] |
Definition at line 164 of file system.h.
References _duration.
Referenced by hoa_battle::private_battle::BattleEnemyActor::Update(), hoa_battle::private_battle::BattleCharacterActor::Update(), and hoa_battle::private_battle::ScriptEvent::Update().
| hoa_mode_manager::GameMode* hoa_system::SystemTimer::GetModeOwner | ( | ) | const [inline] |
| int32 hoa_system::SystemTimer::GetNumberLoops | ( | ) | const [inline] |
| SYSTEM_TIMER_STATE hoa_system::SystemTimer::GetState | ( | ) | const [inline] |
| uint32 hoa_system::SystemTimer::GetTimeExpired | ( | ) | const [inline] |
Definition at line 173 of file system.h.
References _time_expired.
Referenced by hoa_map::MapMode::Draw().
| uint32 hoa_system::SystemTimer::GetTimeLeft | ( | ) | const [inline] |
Definition at line 177 of file system.h.
References _duration, and _time_expired.
| uint32 hoa_system::SystemTimer::GetTimesCompleted | ( | ) | const [inline] |
| void hoa_system::SystemTimer::Initialize | ( | uint32 | duration, | |
| int32 | number_loops = 0, |
|||
| hoa_mode_manager::GameMode * | mode_owner = NULL | |||
| ) |
Initializes the critical members of the system timer class.
| duration | The duration (in milliseconds) that the timer should count for | |
| number_loops | The number of times that the timer should loop its counter. Default value is set to no looping. | |
| mode_owner | A pointer to the GameMode which owns this class. Default value is set to NULL (no owner). |
Definition at line 61 of file system.cpp.
References _duration, _mode_owner, _number_loops, _state, hoa_system::GameSystem::_system_timers, _time_expired, _times_completed, hoa_system::SYSTEM_TIMER_INITIAL, hoa_system::SYSTEM_TIMER_INVALID, and hoa_system::SystemManager.
Referenced by hoa_battle::private_battle::BattleActor::BattleActor(), hoa_battle::private_battle::ScriptEvent::ScriptEvent(), SystemTimer(), and hoa_battle::private_battle::BattleActor::TEMP_ResetAttackTimer().
| bool hoa_system::SystemTimer::IsFinished | ( | ) | const [inline] |
Definition at line 143 of file system.h.
References _state, and hoa_system::SYSTEM_TIMER_FINISHED.
Referenced by hoa_battle::BattleMode::_UpdateCharacterSelection(), hoa_map::MapMode::Draw(), hoa_battle::BattleMode::GetIndexOfFirstIdleCharacter(), hoa_battle::private_battle::BattleActor::TEMP_IsAttacking(), hoa_battle::private_battle::BattleEnemyActor::Update(), hoa_battle::private_battle::BattleCharacterActor::Update(), and hoa_battle::BattleMode::Update().
| bool hoa_system::SystemTimer::IsInitial | ( | ) | const [inline] |
Definition at line 134 of file system.h.
References _state, and hoa_system::SYSTEM_TIMER_INITIAL.
Referenced by Run(), SetDuration(), SetModeOwner(), and SetNumberLoops().
| bool hoa_system::SystemTimer::IsPaused | ( | ) | const [inline] |
Definition at line 140 of file system.h.
References _state, and hoa_system::SYSTEM_TIMER_PAUSED.
Referenced by Run().
| bool hoa_system::SystemTimer::IsRunning | ( | ) | const [inline] |
Definition at line 137 of file system.h.
References _state, and hoa_system::SYSTEM_TIMER_RUNNING.
Referenced by _UpdateTimer(), Pause(), hoa_battle::private_battle::BattleEnemyActor::Update(), hoa_battle::private_battle::BattleCharacterActor::Update(), and hoa_battle::private_battle::ScriptEvent::Update().
| void hoa_system::SystemTimer::Pause | ( | ) | [inline] |
Pauses the timer if it is running.
Definition at line 129 of file system.h.
References _state, IsRunning(), and hoa_system::SYSTEM_TIMER_PAUSED.
Here is the call graph for this function:

| void hoa_system::SystemTimer::Reset | ( | ) | [inline] |
Resets the timer to its initial state.
Definition at line 121 of file system.h.
References _state, _time_expired, _times_completed, hoa_system::SYSTEM_TIMER_INITIAL, and hoa_system::SYSTEM_TIMER_INVALID.
Referenced by hoa_battle::private_battle::BattleActor::OnDeath(), and hoa_battle::private_battle::BattleActor::ResetWaitTime().
| void hoa_system::SystemTimer::Run | ( | ) | [inline] |
Starts the timer from the initial state or resumes it if it is paused.
Definition at line 125 of file system.h.
References _state, IsInitial(), IsPaused(), and hoa_system::SYSTEM_TIMER_RUNNING.
Referenced by hoa_battle::private_battle::BattleActor::BattleActor(), hoa_battle::private_battle::BattleActor::OnLife(), hoa_map::MapMode::Reset(), hoa_battle::private_battle::BattleActor::ResetWaitTime(), hoa_battle::private_battle::ScriptEvent::ScriptEvent(), and hoa_battle::private_battle::BattleActor::TEMP_ResetAttackTimer().
Here is the call graph for this function:

| void hoa_system::SystemTimer::SetDuration | ( | uint32 | duration | ) |
Definition at line 79 of file system.cpp.
References _duration, IsInitial(), and hoa_system::SYSTEM_DEBUG.
Here is the call graph for this function:

| void hoa_system::SystemTimer::SetModeOwner | ( | hoa_mode_manager::GameMode * | mode_owner | ) |
Definition at line 107 of file system.cpp.
References _mode_owner, IsInitial(), and hoa_system::SYSTEM_DEBUG.
Here is the call graph for this function:

| void hoa_system::SystemTimer::SetNumberLoops | ( | int32 | number_loops | ) |
Definition at line 93 of file system.cpp.
References _number_loops, IsInitial(), and hoa_system::SYSTEM_DEBUG.
Here is the call graph for this function:

friend class GameSystem [friend] |
uint32 hoa_system::SystemTimer::_duration [private] |
The duration (in milliseconds) that the timer should run for.
Definition at line 195 of file system.h.
Referenced by _UpdateTimer(), GetDuration(), GetTimeLeft(), Initialize(), and SetDuration().
A pointer to the game mode object which owns this timer, or NULL if it is unowned.
Definition at line 201 of file system.h.
Referenced by GetModeOwner(), Initialize(), and SetModeOwner().
int32 hoa_system::SystemTimer::_number_loops [private] |
The number of loops the timer should run for. -1 indicates infinite looping.
Definition at line 198 of file system.h.
Referenced by _UpdateTimer(), GetNumberLoops(), Initialize(), and SetNumberLoops().
Maintains the current state of the timer (initial, running, paused, or finished).
Definition at line 192 of file system.h.
Referenced by _UpdateTimer(), GetState(), Initialize(), IsFinished(), IsInitial(), IsPaused(), IsRunning(), Pause(), Reset(), Run(), and ~SystemTimer().
uint32 hoa_system::SystemTimer::_time_expired [private] |
The amount of time that has expired on the current timer loop (counts up from 0 to _duration).
Definition at line 204 of file system.h.
Referenced by _UpdateTimer(), GetTimeExpired(), GetTimeLeft(), Initialize(), and Reset().
Incremented by one each time the timer reaches the finished state.
Definition at line 207 of file system.h.
Referenced by _UpdateTimer(), GetCurrentLoop(), GetTimesCompleted(), Initialize(), and Reset().
1.5.1