|
| History () |
| Initialises the history object and sets the mode to none.
|
|
void | initRecording () |
| Initialise the history for a new recording.
|
|
void | Save () |
| Saves the history stored in the internal data structures into a file called history.dat.
|
|
void | Load () |
| Loads a history from history.dat in the current directory.
|
|
void | updateReplay (int world_ticks) |
| Sets the kart position and controls to the recorded history value.
|
|
void | addEvent (int kart_id, PlayerAction pa, int value) |
| Stores an input event (e.g.
|
|
const std::string & | getKartIdent (unsigned int n) |
| Returns the identifier of the n-th kart.
|
|
bool | replayHistory () const |
| Returns if a history is replayed, i.e.
|
|
void | setReplayHistory (bool b) |
| Set if replay is enabled or not.
|
|
|
static bool | m_online_history_replay = false |
|
|
bool | m_replay_history |
| True if a history should be replayed,.
|
|
unsigned int | m_event_index |
| Points to the last used input event index.
|
|
std::vector< std::string > | m_kart_ident |
| The identities of the karts to use.
|
|
std::vector< InputEvent > | m_all_input_events |
| All input events.
|
|
◆ addEvent()
void History::addEvent |
( |
int |
kart_id, |
|
|
PlayerAction |
pa, |
|
|
int |
value |
|
) |
| |
Stores an input event (e.g.
acceleration or steering event) into the history data for physics replay.
- Parameters
-
kart_id | The kart index which triggered the event. |
pa | The action. |
value | Value of the action (0=release, 32768 = pressed), in between in case of analog devices. |
◆ allocateMemory()
void History::allocateMemory |
( |
int |
size = -1 | ) |
|
|
private |
Allocates memory for the history.
This is used when recording as well as when replaying (since in replay the data is read into memory first).
- Parameters
-
number_of_frames | Maximum number of frames to store. |
◆ initRecording()
void History::initRecording |
( |
| ) |
|
Initialise the history for a new recording.
It especially allocates memory to store the history.
◆ replayHistory()
bool History::replayHistory |
( |
| ) |
const |
|
inline |
Returns if a history is replayed, i.e.
the history mode is not none.
◆ updateReplay()
void History::updateReplay |
( |
int |
world_ticks | ) |
|
Sets the kart position and controls to the recorded history value.
- Parameters
-
world_ticks | WOrld time in ticks. |
ticks | Number of time steps. |
The documentation for this class was generated from the following files: