Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
TimeSystem
TimeManipulator.cpp
Go to the documentation of this file.
1
#include "
TimeManipulator.hpp
"
2
#include "
TimeSystem.hpp
"
3
4
namespace
iv
5
{
6
7
TimeManipulator::TimeManipulator
(
Instance
* inst ) :
8
inst( inst ),
9
ts( inst->getSystemContainer()->getSystem<
TimeSystem
>() )
10
{
11
}
12
13
Instance
*
TimeManipulator::instance
()
14
{
15
return
this->inst;
16
}
17
18
void
TimeManipulator::speed
(
TimeId
time_type,
double
speed )
19
{
20
if
( this->ts )
21
this->ts->
speed
( time_type,
speed
);
22
}
23
24
double
TimeManipulator::speed
(
TimeId
time_type )
25
{
26
if
( this->ts )
27
return
this->ts->
speed
( time_type );
28
else
29
return
1.0;
30
}
31
32
void
TimeManipulator::game_update_period
(
TimeId
time_type,
int
period_ms )
33
{
34
if
( !this->ts )
35
return
;
36
37
this->ts->
game_update_period
( time_type, period_ms );
38
}
39
40
int
TimeManipulator::game_update_period
(
TimeId
time_type )
41
{
42
if
( !this->ts )
43
return
16;
44
45
return
this->ts->
game_update_period
( time_type );
46
}
47
48
}