#include <system.h>
Inheritance diagram for hoa_system::GameSystem:


Public Member Functions | |
| void | ExamineSystemTimers () |
| Checks all system timers for whether they should be paused or resumed This function is typically called whenever the GameModeManager class has changed the active game mode. When this is done, all system timers that are owned by the new game mode are resumed, all timers with a different owner are paused, and all timers with no owner are ignored. | |
| void | ExitGame () |
| The function to call to initialize the exit process of the game. | |
| std::string | GetLanguage () const |
| Used to determine what language the game is running in. | |
| uint32 | GetUpdateTime () const |
| Retrieves the amount of time that the game should be updated by for time-based movement. This function should only be called in the main game loop, located in main.cpp. | |
| void | InitializeTimers () |
| Initializes the timers used in the game. | |
| bool | NotDone () const |
| Determines whether the user is done with the game. | |
| void | SetLanguage (std::string lang) |
| Sets the language that the game should use. | |
| void | SetPlayTime (const uint8 h, const uint8 m, const uint8 s) |
| Sets the play-time of a game instance. | |
| bool | SingletonInitialize () |
| A method for the inheriting class to implement, which initializes the class. | |
| void | UpdateTimers () |
| Updates the game timer variables. | |
| ~GameSystem () | |
| uint8 | GetPlayHours () const |
| Functions for retrieving the play time. | |
| uint8 | GetPlayMinutes () const |
| uint8 | GetPlaySeconds () const |
Private Member Functions | |
| GameSystem () | |
Private Attributes | |
| std::string | _language |
| The language in which to render text. | |
| uint32 | _last_update |
| The last time that the UpdateTimers function was called, in milliseconds. | |
| bool | _not_done |
| When this member is set to false, the program will exit. | |
| std::set< SystemTimer * > | _system_timers |
| A set container for all SystemTimer objects that have been initialized The timers in this container are updated on each call to UpdateTimers(). Timers are inserted and erased from this class not by the SystemManager, but by the SystemTimer objects themselves. | |
| uint32 | _update_time |
| The number of milliseconds that have transpired on the last timer update. | |
Play time variables | |
Timers that retain the total amount of time that the user has been playing When the player starts a new game or loads an existing game, these timers are reset. | |
| uint8 | _hours_played |
| uint16 | _milliseconds_played |
| |
| uint8 | _minutes_played |
| uint8 | _seconds_played |
Friends | |
| class | hoa_utils::Singleton< GameSystem > |
| class | SystemTimer |
****************************************************************************
This is somewhat of a "miscellaneous" game engine class that manages constructs that don't really fit in with any other engine component. Perhaps the most important task that this engine component handles is that of timing.
Definition at line 226 of file system.h.
| hoa_system::GameSystem::~GameSystem | ( | ) |
| hoa_system::GameSystem::GameSystem | ( | ) | [private] |
Definition at line 150 of file system.cpp.
References _language, _not_done, and hoa_system::SYSTEM_DEBUG.
| void hoa_system::GameSystem::ExamineSystemTimers | ( | ) |
Checks all system timers for whether they should be paused or resumed This function is typically called whenever the GameModeManager class has changed the active game mode. When this is done, all system timers that are owned by the new game mode are resumed, all timers with a different owner are paused, and all timers with no owner are ignored.
Definition at line 241 of file system.cpp.
References _system_timers, hoa_mode_manager::GameModeManager::GetTop(), and hoa_mode_manager::ModeManager.
Referenced by hoa_mode_manager::GameModeManager::Update().
Here is the call graph for this function:

| void hoa_system::GameSystem::ExitGame | ( | ) | [inline] |
The function to call to initialize the exit process of the game.
Definition at line 312 of file system.h.
References _not_done.
Referenced by hoa_input::GameInput::_JoystickEventHandler(), hoa_input::GameInput::_KeyEventHandler(), hoa_boot::BootMode::_OnQuit(), hoa_quit::QuitMode::_QuitGame(), hoa_boot::BootMode::BootMode(), hoa_input::GameInput::EventHandler(), and hoa_battle::BattleMode::SetPerformingScript().
| std::string hoa_system::GameSystem::GetLanguage | ( | ) | const [inline] |
| uint8 hoa_system::GameSystem::GetPlayHours | ( | ) | const [inline] |
Functions for retrieving the play time.
Definition at line 282 of file system.h.
References _hours_played.
Referenced by hoa_menu::MenuMode::_DrawBottomMenu().
| uint8 hoa_system::GameSystem::GetPlayMinutes | ( | ) | const [inline] |
Definition at line 285 of file system.h.
References _minutes_played.
Referenced by hoa_menu::MenuMode::_DrawBottomMenu().
| uint8 hoa_system::GameSystem::GetPlaySeconds | ( | ) | const [inline] |
Definition at line 288 of file system.h.
References _seconds_played.
Referenced by hoa_menu::MenuMode::_DrawBottomMenu().
| uint32 hoa_system::GameSystem::GetUpdateTime | ( | ) | const [inline] |
Retrieves the amount of time that the game should be updated by for time-based movement. This function should only be called in the main game loop, located in main.cpp.
Definition at line 265 of file system.h.
References _update_time.
Referenced by hoa_boot::BootMode::_AnimateLogo(), hoa_system::SystemTimer::_UpdateTimer(), hoa_battle::private_battle::BattleEnemyActor::DrawSprite(), hoa_battle::private_battle::BattleCharacterActor::DrawSprite(), hoa_map::private_map::ActionAnimate::Execute(), hoa_map::private_map::ActionRandomMove::Execute(), main(), hoa_shop::private_shop::ObjectSellListWindow::Update(), hoa_shop::private_shop::ObjectListWindow::Update(), hoa_shop::private_shop::ShopActionWindow::Update(), hoa_scene::SceneMode::Update(), hoa_quit::QuitMode::Update(), hoa_menu::private_menu::InventoryWindow::Update(), hoa_map::private_map::EnemySprite::Update(), hoa_map::MapMode::Update(), hoa_boot::BootMode::Update(), hoa_battle::private_battle::ActionWindow::Update(), hoa_battle::private_battle::BattleEnemyActor::Update(), hoa_battle::private_battle::BattleCharacterActor::Update(), hoa_battle::private_battle::ScriptEvent::Update(), and hoa_audio::GameAudio::Update().
| void hoa_system::GameSystem::InitializeTimers | ( | ) |
Initializes the timers used in the game.
This function should only be called once in main.cpp, just before the main game loop begins.
Definition at line 199 of file system.cpp.
References _hours_played, _last_update, _milliseconds_played, _minutes_played, _seconds_played, _system_timers, and _update_time.
Referenced by InitializeEngine().
| bool hoa_system::GameSystem::NotDone | ( | ) | const [inline] |
| void hoa_system::GameSystem::SetLanguage | ( | std::string | lang | ) |
Sets the language that the game should use.
| lang | A two-character string representing the language to execute the game in |
Definition at line 259 of file system.cpp.
References _language.
Sets the play-time of a game instance.
| h | The amount of hours to set. | |
| m | The amount of minutes to set. | |
| s | The amount of seconds to set. |
Definition at line 275 of file system.h.
References _hours_played, _milliseconds_played, _minutes_played, and _seconds_played.
| bool hoa_system::GameSystem::SingletonInitialize | ( | ) | [virtual] |
A method for the inheriting class to implement, which initializes the class.
Implements hoa_utils::Singleton< T >.
Definition at line 167 of file system.cpp.
References hoa_audio::AudioManager, hoa_script::ReadScriptDescriptor::CloseFile(), hoa_script::ReadScriptDescriptor::CloseTable(), hoa_script::ScriptDescriptor::GetErrorMessages(), hoa_script::ScriptDescriptor::IsErrorDetected(), hoa_script::ReadScriptDescriptor::OpenFile(), hoa_script::ReadScriptDescriptor::OpenTable(), hoa_script::ReadScriptDescriptor::ReadFloat(), hoa_audio::GameAudio::SetMusicVolume(), and hoa_audio::GameAudio::SetSoundVolume().
Referenced by InitializeEngine().
Here is the call graph for this function:

| void hoa_system::GameSystem::UpdateTimers | ( | ) |
Updates the game timer variables.
This function should only be called once for each cycle through the main game loop. Since it is called inside the loop in main.cpp, you should have no reason to call this function anywhere else.
Definition at line 211 of file system.cpp.
References _hours_played, _last_update, _milliseconds_played, _minutes_played, _seconds_played, _system_timers, and _update_time.
Referenced by hoa_battle::BattleMode::_Initialize(), and main().
friend class hoa_utils::Singleton< GameSystem > [friend] |
friend class SystemTimer [friend] |
uint8 hoa_system::GameSystem::_hours_played [private] |
Definition at line 328 of file system.h.
Referenced by GetPlayHours(), InitializeTimers(), SetPlayTime(), and UpdateTimers().
std::string hoa_system::GameSystem::_language [private] |
The language in which to render text.
Definition at line 341 of file system.h.
Referenced by GameSystem(), GetLanguage(), and SetLanguage().
uint32 hoa_system::GameSystem::_last_update [private] |
The last time that the UpdateTimers function was called, in milliseconds.
Definition at line 319 of file system.h.
Referenced by InitializeTimers(), and UpdateTimers().
Definition at line 332 of file system.h.
Referenced by InitializeTimers(), SetPlayTime(), and UpdateTimers().
uint8 hoa_system::GameSystem::_minutes_played [private] |
Definition at line 329 of file system.h.
Referenced by GetPlayMinutes(), InitializeTimers(), SetPlayTime(), and UpdateTimers().
bool hoa_system::GameSystem::_not_done [private] |
When this member is set to false, the program will exit.
Definition at line 336 of file system.h.
Referenced by ExitGame(), GameSystem(), and NotDone().
uint8 hoa_system::GameSystem::_seconds_played [private] |
Definition at line 330 of file system.h.
Referenced by GetPlaySeconds(), InitializeTimers(), SetPlayTime(), and UpdateTimers().
std::set<SystemTimer*> hoa_system::GameSystem::_system_timers [private] |
A set container for all SystemTimer objects that have been initialized The timers in this container are updated on each call to UpdateTimers(). Timers are inserted and erased from this class not by the SystemManager, but by the SystemTimer objects themselves.
Definition at line 348 of file system.h.
Referenced by ExamineSystemTimers(), hoa_system::SystemTimer::Initialize(), InitializeTimers(), UpdateTimers(), and hoa_system::SystemTimer::~SystemTimer().
uint32 hoa_system::GameSystem::_update_time [private] |
The number of milliseconds that have transpired on the last timer update.
Definition at line 321 of file system.h.
Referenced by GetUpdateTime(), InitializeTimers(), and UpdateTimers().
1.5.1