DDraceNetwork Docs
race_demo.h
Go to the documentation of this file.
1/* (c) Redix and Sushi */
2
3#ifndef GAME_CLIENT_COMPONENTS_RACE_DEMO_H
4#define GAME_CLIENT_COMPONENTS_RACE_DEMO_H
5
6#include <chrono>
8
9class CRaceDemo : public CComponent
10{
11 enum
12 {
18 };
19
20 static const char *ms_pRaceDemoDir;
21
22 char m_aTmpFilename[128];
23
27 int m_Time;
28
29 std::chrono::nanoseconds m_RaceDemosLoadStartTime{0};
30
31 static int RaceDemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser);
32
33 void GetPath(char *pBuf, int Size, int Time = -1) const;
34
35 void StopRecord(int Time = -1);
36 bool CheckDemo(int Time);
37
38public:
40
41 CRaceDemo();
42 virtual int Sizeof() const override { return sizeof(*this); }
43
44 virtual void OnReset() override;
45 virtual void OnStateChange(int NewState, int OldState) override;
46 virtual void OnMessage(int MsgType, void *pRawMsg) override;
47 virtual void OnMapLoad() override;
48 virtual void OnShutdown() override;
49 virtual void OnNewSnapshot() override;
50};
51#endif
Definition: component.h:20
Definition: race_demo.h:10
virtual void OnMapLoad() override
Definition: race_demo.cpp:164
int m_RaceStartTick
Definition: race_demo.h:25
virtual int Sizeof() const override
Definition: race_demo.h:42
static const char * ms_pRaceDemoDir
Definition: race_demo.h:20
virtual void OnMessage(int MsgType, void *pRawMsg) override
Definition: race_demo.cpp:129
std::chrono::nanoseconds m_RaceDemosLoadStartTime
Definition: race_demo.h:29
int m_RaceState
Definition: race_demo.h:24
char m_aTmpFilename[128]
Definition: race_demo.h:22
CRaceDemo()
Definition: race_demo.cpp:35
virtual void OnStateChange(int NewState, int OldState) override
Definition: race_demo.cpp:54
int m_Time
Definition: race_demo.h:27
virtual void OnReset() override
Definition: race_demo.cpp:119
virtual void OnNewSnapshot() override
Definition: race_demo.cpp:60
virtual void OnShutdown() override
Definition: race_demo.cpp:124
static int RaceDemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser)
Definition: race_demo.cpp:202
bool m_AllowRestart
Definition: race_demo.h:39
void StopRecord(int Time=-1)
Definition: race_demo.cpp:169
@ RACE_NONE
Definition: race_demo.h:13
@ RACE_STARTED
Definition: race_demo.h:16
@ RACE_PREPARE
Definition: race_demo.h:15
@ RACE_IDLE
Definition: race_demo.h:14
@ RACE_FINISHED
Definition: race_demo.h:17
void GetPath(char *pBuf, int Size, int Time=-1) const
Definition: race_demo.cpp:38
bool CheckDemo(int Time)
Definition: race_demo.cpp:242
int m_RecordStopTick
Definition: race_demo.h:26
Definition: types.h:23