#include <time.h>
Collaboration diagram for Time:
Public Member Functions | |
void | Reset () |
bool | IsGamePaused () const |
uint | Read () const |
uint | ReadSec () const |
uint | ReadMin () const |
void | Refresh () |
uint | GetDelta () const |
void | RefreshMaxTime (uint updated_max_time) |
uint | ClockSec () |
uint | ClockMin () |
std::string | GetString () |
void | Pause () |
void | Continue () |
Static Public Member Functions | |
static Time * | GetInstance () |
Private Member Functions | |
Time () | |
Private Attributes | |
uint | current_time |
uint | max_time |
uint | delta_t |
bool | is_game_paused |
Static Private Attributes | |
static Time * | singleton = NULL |
Definition at line 28 of file time.h.
Time::Time | ( | ) | [private] |
Definition at line 48 of file time.cpp.
00048 { 00049 is_game_paused = false; 00050 delta_t = 20; 00051 }
Here is the caller graph for this function:
uint Time::ClockMin | ( | ) |
uint Time::ClockSec | ( | ) |
void Time::Continue | ( | ) |
Definition at line 101 of file time.cpp.
00101 { 00102 assert (is_game_paused); 00103 is_game_paused = false; 00104 }
Here is the caller graph for this function:
uint Time::GetDelta | ( | ) | const |
Time * Time::GetInstance | ( | ) | [static] |
std::string Time::GetString | ( | ) |
bool Time::IsGamePaused | ( | ) | const |
Definition at line 44 of file time.cpp.
00044 { 00045 return is_game_paused; 00046 }
Here is the caller graph for this function:
void Time::Pause | ( | ) |
Definition at line 95 of file time.cpp.
00095 { 00096 if (is_game_paused) 00097 return; 00098 is_game_paused = true; 00099 }
Here is the caller graph for this function:
uint Time::Read | ( | ) | const |
Definition at line 58 of file time.cpp.
00058 { 00059 return current_time; 00060 }
Here is the caller graph for this function:
uint Time::ReadMin | ( | ) | const |
uint Time::ReadSec | ( | ) | const |
void Time::Refresh | ( | ) |
Definition at line 62 of file time.cpp.
00062 { 00063 /* 00064 TODO : Activate this condition later. 00065 Refresh time condition : 00066 - active team is Local 00067 - current node is server and game loop is not in Playing state 00068 - game don't use network 00069 if((ActiveTeam().IsLocal() || ActiveTeam().IsLocalAI()) || 00070 (network.IsServer() && GameLoop::GetInstance()->ReadState() != GameLoop::PLAYING) || 00071 (!network.IsServer() && !network.IsClient()) || 00072 current_time < max_time) 00073 */ 00074 current_time += delta_t; 00075 RefreshMaxTime(current_time); 00076 }
Here is the call graph for this function:
Here is the caller graph for this function:
void Time::RefreshMaxTime | ( | uint | updated_max_time | ) |
void Time::Reset | ( | ) |
Definition at line 53 of file time.cpp.
00053 { 00054 current_time = 0; 00055 is_game_paused = false; 00056 }
Here is the caller graph for this function:
uint Time::current_time [private] |
uint Time::delta_t [private] |
bool Time::is_game_paused [private] |
uint Time::max_time [private] |
Time * Time::singleton = NULL [static, private] |