#include <Watch.hpp>
Definition at line 16 of file Watch.hpp.
◆ Watch()
◆ instance()
◆ time_type() [1/2]
void iv::Watch::time_type |
( |
TimeId |
tt | ) |
|
◆ time_type() [2/2]
TimeId iv::Watch::time_type |
( |
| ) |
|
◆ time_ms()
int iv::Watch::time_ms |
( |
| ) |
|
Returns game time in milliseconds from when the TimeId started (this does not increase if TimeId used by this Watch is paused).
Definition at line 60 of file Watch.cpp.
◆ delta_ms()
int iv::Watch::delta_ms |
( |
| ) |
|
Returns delta time from last time Watch::delta_ms was called on this instance (or from when it was constructed when this is the first time it is called).
Definition at line 68 of file Watch.cpp.
◆ time_to_next_frame_ms()
int iv::Watch::time_to_next_frame_ms |
( |
| ) |
|
TODO - tohle odebrat a dát sem nějaký mechanizmus, který zaručí, že některé timeouty budou maximálně jednou za nějaký čas (ne jednou za frame, ale jednou za nějaké simulační epsilon) Možná sem ale dát jenom nějaký helper, který pomůže klientskému kódu definovat si to časové epsilon sám. Protože u některých simulací potřebujeme jiný minimální simulační krok než u ostatních - každá simulace je jinak akční a tedy jinak náchylná na chybějící kroky. Tohle se mimochodem používá zatím asi jenom v rising_sun/Behaviors/WorldPhysics/CentroidMotion.cpp.
Definition at line 126 of file Watch.cpp.
◆ timeout()
void iv::Watch::timeout |
( |
int |
delta_ms, |
|
|
std::function< void() > const & |
fun |
|
) |
| |
Called once after 'delta_ms' time passed. It is not called if this instance of Watch is destroyed before timeout.
Definition at line 81 of file Watch.cpp.
◆ timeout_unique() [1/2]
void iv::Watch::timeout_unique |
( |
int |
delta_ms, |
|
|
std::function< void() > const & |
fun |
|
) |
| |
Calling this second time will remove the previous timeout, so only one timeout_unique can be pending simultaneously.
Definition at line 87 of file Watch.cpp.
◆ timeout_unique() [2/2]
void iv::Watch::timeout_unique |
( |
| ) |
|
This cancels current timeout_unique.
Definition at line 108 of file Watch.cpp.
◆ delay()
void iv::Watch::delay |
( |
std::function< void() > const & |
fun | ) |
|
Function is called once later in this frame. This is useful to avoid dangerous recursions. It is not called if this instance of Watch is destroyed before it is called.
Definition at line 120 of file Watch.cpp.
◆ cm
The documentation for this class was generated from the following files: