1#ifndef ENGINE_GHOST_H
2#define ENGINE_GHOST_H
3
4#include <base/hash.h>
5#include <engine/shared/protocol.h>
6
7#include "kernel.h"
8
9class CGhostInfo
10{
11public:
12 char m_aOwner[MAX_NAME_LENGTH];
13 char m_aMap[64];
14 int m_NumTicks;
15 int m_Time;
16};
17
18class IGhostRecorder : public IInterface
19{
20 MACRO_INTERFACE("ghostrecorder")
21public:
22 virtual ~IGhostRecorder() {}
23
24 virtual int Start(const char *pFilename, const char *pMap, SHA256_DIGEST MapSha256, const char *pName) = 0;
25 virtual int Stop(int Ticks, int Time) = 0;
26
27 virtual void WriteData(int Type, const void *pData, int Size) = 0;
28 virtual bool IsRecording() const = 0;
29};
30
31class IGhostLoader : public IInterface
32{
33 MACRO_INTERFACE("ghostloader")
34public:
35 virtual ~IGhostLoader() {}
36
37 virtual int Load(const char *pFilename, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc) = 0;
38 virtual void Close() = 0;
39
40 virtual const CGhostInfo *GetInfo() const = 0;
41
42 virtual bool ReadNextType(int *pType) = 0;
43 virtual bool ReadData(int Type, void *pData, int Size) = 0;
44
45 virtual bool GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc) = 0;
46};
47
48#endif
49