Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
TimeSystem
Watch.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
TimeId.hpp
"
4
#include "
TimeSystem.hpp
"
5
#include "../Defs.hpp"
6
#include <
ivorium_core/ivorium_core.hpp
>
7
#include <functional>
8
9
namespace
iv
10
{
11
12
13
class
TimeSystem;
14
class
Instance;
15
16
class
Watch
17
{
18
public
:
19
ClientMarker
cm
;
20
21
Watch
(
Instance
* inst,
TimeId
time_type
=
TimeId
() );
22
Instance
*
instance
();
23
26
void
time_type
(
TimeId
tt );
27
TimeId
time_type
();
28
32
int
time_ms
();
33
37
int
delta_ms
();
38
45
int
time_to_next_frame_ms
();
46
51
void
timeout
(
int
delta_ms
, std::function<
void
() >
const
& fun );
52
56
void
timeout_unique
(
int
delta_ms
, std::function<
void
() >
const
& fun );
57
61
void
timeout_unique
();
62
68
void
delay
( std::function<
void
() >
const
& fun );
69
70
private
:
71
Instance
* inst;
72
TimeSystem
* ts;
73
TimeId
_time_type;
74
int
delta_cache;
75
76
TimeSystem::timeout_iterator
timeout_it;
77
bool
timeout_it_valid;
78
};
79
80
}