SuperTuxKart
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ReplayPlay Class Reference
Inheritance diagram for ReplayPlay:
Inheritance graph
[legend]

Classes

class  ReplayData
 

Public Types

enum  SortOrder {
  SO_DEFAULT, SO_TRACK = SO_DEFAULT, SO_REV, SO_KART_NUM,
  SO_DIFF, SO_LAPS, SO_TIME, SO_USER,
  SO_VERSION
}
 Order of sort for ReplayData.
 

Public Member Functions

void reset ()
 Resets all ghost karts back to start position.
 
void load ()
 
void loadFile (bool second_replay)
 
void loadAllReplayFile ()
 
void sortReplay (bool reverse)
 
void setReplayFile (unsigned int n)
 
void setSecondReplayFile (unsigned int n, bool second_replay_enabled)
 
void setReplayFileByUID (uint64_t uid)
 call getReplayIdByUID and set the current replay file to the first one with a matching UID. More...
 
unsigned int getReplayIdByUID (uint64_t uid)
 Search among replay file and return the first index with a matching UID. More...
 
bool addReplayFile (const std::string &fn, bool custom_replay=false, int call_index=0)
 
const ReplayDatagetReplayData (unsigned int n) const
 
const ReplayDatagetCurrentReplayData () const
 
const unsigned int getNumReplayFile () const
 
std::shared_ptr< GhostKartgetGhostKart (int n)
 
const unsigned int getNumGhostKart () const
 
const std::string & getGhostKartName (unsigned int n) const
 
virtual const std::string & getReplayFilename (int replay_file_number=1) const
 Returns the filename that was opened. More...
 
unsigned int getCurrentReplayFileIndex () const
 
unsigned int getSecondReplayFileIndex () const
 
bool isSecondReplayEnabled () const
 

Static Public Member Functions

static void setSortOrder (SortOrder so)
 
static void create ()
 Creates a new instance of the replay object. More...
 
static ReplayPlayget ()
 Returns the instance of the replay object. More...
 
static void destroy ()
 Delete the instance of the replay object. More...
 

Private Member Functions

 ReplayPlay ()
 Initialises the Replay engine.
 
 ~ReplayPlay ()
 Frees all stored data. More...
 
void readKartData (FILE *fd, char *next_line, bool second_replay)
 Reads all data from a replay file for a specific kart. More...
 

Private Attributes

unsigned int m_current_replay_file
 
unsigned int m_second_replay_file
 
bool m_second_replay_enabled
 
std::vector< ReplayDatam_replay_file_list
 
std::vector< std::shared_ptr< GhostKart > > m_ghost_karts
 All ghost karts. More...
 

Static Private Attributes

static ReplayPlaym_replay_play = NULL
 
static SortOrder m_sort_order = ReplayPlay::SO_DEFAULT
 

Additional Inherited Members

- Protected Member Functions inherited from ReplayBase
FILE * openReplayFile (bool writeable, bool full_path=false, int replay_file_number=1)
 Opens a replay file which is determined by sub classes. More...
 
unsigned int getCurrentReplayVersion () const
 Returns the version number of the replay file recorderd by this executable. More...
 
unsigned int getMinSupportedReplayVersion () const
 This is used to check that a loaded replay file can still be understood by this executable. More...
 

Constructor & Destructor Documentation

◆ ~ReplayPlay()

ReplayPlay::~ReplayPlay ( )
private

Frees all stored data.

Member Function Documentation

◆ create()

static void ReplayPlay::create ( )
inlinestatic

Creates a new instance of the replay object.

◆ destroy()

static void ReplayPlay::destroy ( )
inlinestatic

Delete the instance of the replay object.

◆ get()

static ReplayPlay* ReplayPlay::get ( )
inlinestatic

Returns the instance of the replay object.

◆ getReplayFilename()

virtual const std::string& ReplayPlay::getReplayFilename ( int  replay_file_number = 1) const
inlinevirtual

Returns the filename that was opened.

Implements ReplayBase.

◆ getReplayIdByUID()

unsigned int ReplayPlay::getReplayIdByUID ( uint64_t  uid)

Search among replay file and return the first index with a matching UID.

Parameters
uidThe UID to match

◆ readKartData()

void ReplayPlay::readKartData ( FILE *  fd,
char *  next_line,
bool  second_replay 
)
private

Reads all data from a replay file for a specific kart.

Parameters
fdThe file descriptor from which to read.

◆ setReplayFileByUID()

void ReplayPlay::setReplayFileByUID ( uint64_t  uid)

call getReplayIdByUID and set the current replay file to the first one with a matching UID.

Parameters
uidThe UID to match

Member Data Documentation

◆ m_ghost_karts

std::vector<std::shared_ptr<GhostKart> > ReplayPlay::m_ghost_karts
private

All ghost karts.


The documentation for this class was generated from the following files: