19#ifndef HEADER_REPLAY_RECORDER_HPP
20#define HEADER_REPLAY_RECORDER_HPP
22#include "items/attachment.hpp"
23#include "items/powerup_manager.hpp"
24#include "karts/controller/kart_control.hpp"
25#include "replay/replay_base.hpp"
35 std::string m_filename;
58 bool m_complete_replay;
60 bool m_incorrect_replay;
62 unsigned int m_max_frames;
66 float m_previous_steer = 0.0f;
68 const float DISTANCE_FAST_UPDATES = 10.0f;
70 const float DISTANCE_MAX_UPDATES = 1.0f;
79 unsigned int m_count_skipped_time;
82 unsigned int m_count_skipped_interpolation;
97 const uint64_t getLastUID() {
return m_last_uid; }
102 static int enumToCode (Attachment::AttachmentType type);
103 static int enumToCode (PowerupManager::PowerupType type);
104 static Attachment::AttachmentType codeToEnumAttach (
int code);
105 static PowerupManager::PowerupType codeToEnumItem (
int code);
122 virtual const std::string&
getReplayFilename(
int replay_file_number = 1)
const {
return m_filename; }
Definition: replay_base.hpp:33
Definition: replay_recorder.hpp:33
ReplayRecorder()
Initialises the Replay engine.
Definition: replay_recorder.cpp:50
std::vector< float > m_last_saved_time
Time at which a transform was saved for the last time.
Definition: replay_recorder.hpp:50
std::vector< unsigned int > m_count_transforms
Counts the number of transform events for each kart.
Definition: replay_recorder.hpp:53
static int enumToCode(Attachment::AttachmentType type)
Functions to encode and decode attahcments and item types, so that the stored value is independent fr...
Definition: replay_recorder.cpp:489
static ReplayRecorder * get()
Returns the instance of the replay object.
Definition: replay_recorder.hpp:116
virtual const std::string & getReplayFilename(int replay_file_number=1) const
Returns the filename that was opened.
Definition: replay_recorder.hpp:122
uint64_t computeUID(float min_time)
Compute the replay's UID ; partly based on race data ; partly randomly.
Definition: replay_recorder.cpp:317
static void create()
Creates a new instance of the replay object.
Definition: replay_recorder.hpp:109
~ReplayRecorder()
Frees all stored data.
Definition: replay_recorder.cpp:62
void save()
Saves the replay data stored in the internal data structures.
Definition: replay_recorder.cpp:353
std::vector< std::vector< KartReplayEvent > > m_kart_replay_event
A separate vector of Replay Events for all other events.
Definition: replay_recorder.hpp:47
void update(int ticks)
Saves the current replay data.
Definition: replay_recorder.cpp:115
std::vector< std::vector< PhysicInfo > > m_physic_info
A separate vector of Replay Events for all physic info.
Definition: replay_recorder.hpp:41
static ReplayRecorder * m_replay_recorder
Static pointer to the one instance of the replay object.
Definition: replay_recorder.hpp:56
void init()
Initialise the replay recorder.
Definition: replay_recorder.cpp:90
std::vector< std::vector< BonusInfo > > m_bonus_info
A separate vector of Replay Events for all item/nitro info.
Definition: replay_recorder.hpp:44
void reset()
Reset the replay recorder.
Definition: replay_recorder.cpp:68
static void destroy()
Delete the instance of the replay object.
Definition: replay_recorder.hpp:119
std::vector< std::vector< TransformEvent > > m_transform_events
A separate vector of Replay Events for all transforms.
Definition: replay_recorder.hpp:38