DDraceNetwork Docs
map.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef ENGINE_SHARED_MAP_H
4#define ENGINE_SHARED_MAP_H
5
6#include <base/types.h>
7
8#include "datafile.h"
9#include <engine/map.h>
10
11class CMap : public IEngineMap
12{
14
15public:
17
19
20 int GetDataSize(int Index) const override;
21 void *GetData(int Index) override;
22 void *GetDataSwapped(int Index) override;
23 const char *GetDataString(int Index) override;
24 void UnloadData(int Index) override;
25 int NumData() const override;
26
27 int GetItemSize(int Index) override;
28 void *GetItem(int Index, int *pType = nullptr, int *pId = nullptr) override;
29 void GetType(int Type, int *pStart, int *pNum) override;
30 int FindItemIndex(int Type, int Id) override;
31 void *FindItem(int Type, int Id) override;
32 int NumItems() const override;
33
34 bool Load(const char *pMapName) override;
35 void Unload() override;
36 bool IsLoaded() const override;
37 IOHANDLE File() const override;
38
39 SHA256_DIGEST Sha256() const override;
40 unsigned Crc() const override;
41 int MapSize() const override;
42
43 static void ExtractTiles(class CTile *pDest, size_t DestSize, const class CTile *pSrc, size_t SrcSize);
44};
45
46#endif
Definition: datafile.h:24
Definition: map.h:12
int GetItemSize(int Index) override
Definition: map.cpp:43
void * GetItem(int Index, int *pType=nullptr, int *pId=nullptr) override
Definition: map.cpp:48
int NumData() const override
Definition: map.cpp:38
bool IsLoaded() const override
Definition: map.cpp:138
int MapSize() const override
Definition: map.cpp:158
void Unload() override
Definition: map.cpp:133
CDataFileReader * GetReader()
Definition: map.h:18
IOHANDLE File() const override
Definition: map.cpp:143
void * FindItem(int Type, int Id) override
Definition: map.cpp:63
bool Load(const char *pMapName) override
Definition: map.cpp:73
void * GetDataSwapped(int Index) override
Definition: map.cpp:23
static void ExtractTiles(class CTile *pDest, size_t DestSize, const class CTile *pSrc, size_t SrcSize)
Definition: map.cpp:163
const char * GetDataString(int Index) override
Definition: map.cpp:28
void * GetData(int Index) override
Definition: map.cpp:18
int FindItemIndex(int Type, int Id) override
Definition: map.cpp:58
int GetDataSize(int Index) const override
Definition: map.cpp:13
void UnloadData(int Index) override
Definition: map.cpp:33
SHA256_DIGEST Sha256() const override
Definition: map.cpp:148
void GetType(int Type, int *pStart, int *pNum) override
Definition: map.cpp:53
int NumItems() const override
Definition: map.cpp:68
unsigned Crc() const override
Definition: map.cpp:153
CDataFileReader m_DataFile
Definition: map.h:13
Definition: mapitems.h:236
Definition: map.h:35
void * IOHANDLE
Definition: logger.h:11
Definition: hash.h:15