-
Notifications
You must be signed in to change notification settings - Fork 1
/
datamanager.h
executable file
·50 lines (44 loc) · 1.52 KB
/
datamanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef DATAMANAGER_H
#define DATAMANAGER_H
#include <sqlite3.h>
#include <stdio.h>
#include "clientcard.h"
#include "bufferio.h"
namespace glaze {
class DataManager
{
public:
DataManager(): _datas(8192), _strings(8192) {}
bool LoadDB(const char* file);
bool LoadStrings(const char* file);
bool Error(sqlite3* pDB, sqlite3_stmt* pStmt = 0);
bool GetData(int code, CardData* pData);
code_pointer GetCodePointer(int code);
bool GetString(int code, CardString* pStr);
const wchar_t* GetName(int code);
const wchar_t* GetText(int code);
const wchar_t* GetDesc(int strCode);
const wchar_t* GetSysString(int code);
const wchar_t* GetVictoryString(int code);
const wchar_t* GetCounterName(int code);
const wchar_t* GetNumString(int num);
const wchar_t* FormatLocation(int location, int sequence);
const wchar_t* FormatAttribute(int attribute);
const wchar_t* FormatRace(int race);
const wchar_t* FormatType(int type);
std::unordered_map<unsigned int, CardDataC> _datas;
std::unordered_map<unsigned int, CardString> _strings;
std::unordered_map<unsigned int, wchar_t*> _counterStrings;
std::unordered_map<unsigned int, wchar_t*> _victoryStrings;
wchar_t* _sysStrings[2048];
wchar_t numStrings[256][4];
wchar_t attBuffer[128];
wchar_t racBuffer[128];
wchar_t tpBuffer[128];
static wchar_t strBuffer[2048];
static const wchar_t* unknown_string;
static int CardReader(int, void*);
};
extern DataManager dataManager;
}
#endif // DATAMANAGER_H