DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
ghost.h
Go to the documentation of this file.
1
#ifndef ENGINE_GHOST_H
2
#define ENGINE_GHOST_H
3
4
#include "
kernel.h
"
5
6
#include <
base/hash.h
>
7
8
#include <
engine/shared/protocol.h
>
9
10
class
CGhostInfo
11
{
12
public
:
13
char
m_aOwner
[
MAX_NAME_LENGTH
];
14
char
m_aMap
[64];
15
int
m_NumTicks
;
16
int
m_Time
;
17
};
18
19
class
IGhostRecorder
:
public
IInterface
20
{
21
MACRO_INTERFACE
(
"ghostrecorder"
)
22
public:
23
virtual
int
Start
(const
char
*pFilename, const
char
*pMap, const
SHA256_DIGEST
&MapSha256, const
char
*pName) = 0;
24
virtual
void
Stop
(
int
Ticks,
int
Time) = 0;
25
26
virtual
void
WriteData
(
int
Type, const
void
*pData,
size_t
Size) = 0;
27
virtual
bool
IsRecording
() const = 0;
28
};
29
30
class
IGhostLoader
: public
IInterface
31
{
32
MACRO_INTERFACE
(
"ghostloader"
)
33
public:
34
virtual
bool
Load
(const
char
*pFilename, const
char
*pMap, const
SHA256_DIGEST
&MapSha256,
unsigned
MapCrc) = 0;
35
virtual
void
Close
() = 0;
36
37
virtual const
CGhostInfo
*
GetInfo
() const = 0;
38
39
virtual
bool
ReadNextType
(
int
*pType) = 0;
40
virtual
bool
ReadData
(
int
Type,
void
*pData,
size_t
Size) = 0;
41
42
virtual
bool
GetGhostInfo
(const
char
*pFilename,
CGhostInfo
*pInfo, const
char
*pMap, const
SHA256_DIGEST
&MapSha256,
unsigned
MapCrc) = 0;
43
};
44
45
#endif
CGhostInfo
Definition
ghost.h:11
CGhostInfo::m_NumTicks
int m_NumTicks
Definition
ghost.h:15
CGhostInfo::m_aMap
char m_aMap[64]
Definition
ghost.h:14
CGhostInfo::m_aOwner
char m_aOwner[MAX_NAME_LENGTH]
Definition
ghost.h:13
CGhostInfo::m_Time
int m_Time
Definition
ghost.h:16
IGhostLoader
Definition
ghost.h:31
IGhostLoader::GetGhostInfo
virtual bool GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc)=0
IGhostLoader::Load
virtual bool Load(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc)=0
IGhostLoader::GetInfo
virtual const CGhostInfo * GetInfo() const =0
IGhostLoader::ReadData
virtual bool ReadData(int Type, void *pData, size_t Size)=0
IGhostLoader::ReadNextType
virtual bool ReadNextType(int *pType)=0
IGhostLoader::Close
virtual void Close()=0
IGhostRecorder
Definition
ghost.h:20
IGhostRecorder::Stop
virtual void Stop(int Ticks, int Time)=0
IGhostRecorder::Start
virtual int Start(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, const char *pName)=0
IGhostRecorder::WriteData
virtual void WriteData(int Type, const void *pData, size_t Size)=0
IGhostRecorder::IsRecording
virtual bool IsRecording() const =0
IInterface::IInterface
IInterface()
Definition
kernel.h:19
hash.h
kernel.h
MACRO_INTERFACE
#define MACRO_INTERFACE(Name)
Definition
kernel.h:25
protocol.h
MAX_NAME_LENGTH
@ MAX_NAME_LENGTH
Definition
protocol.h:109
SHA256_DIGEST
Definition
hash.h:12
src
engine
ghost.h
Generated by
1.18.0