33 lines
956 B
C++
33 lines
956 B
C++
|
|
#ifndef _BattleArenaDB_h_
|
|
#define _BattleArenaDB_h_
|
|
|
|
#include <toolkit/khash.h>
|
|
|
|
class SBattleArenaDB
|
|
{
|
|
public:
|
|
SBattleArenaDB();
|
|
~SBattleArenaDB();
|
|
/// 파라미터 조건에 맞는 아레나 id를 찾는다,
|
|
/// @return 값을 못 찾았을 때는 -1을 리턴
|
|
int findID(int arenaType, int maxMember);
|
|
struct BattleArenaBase* getData(int arenaId);
|
|
bool isInArena(unsigned int warpx, unsigned int warpy);
|
|
|
|
private:
|
|
void Init();
|
|
void Destroy();
|
|
void Load();
|
|
/// 파라미터 값을 조합하여 key값을 생성
|
|
/// 원래는 minMember도 포함되어 있었으나, minMember는 테스트로 바뀔 수가 있다. 그래서 뺌(타입과 최대 인원으로만 체크해도 문제는 없어 보임)
|
|
void createIdKey(int arenaType, int maxMember, std::string& key);
|
|
|
|
private:
|
|
KHash< struct BattleArenaBase*, hashPr_mod_int> m_hashBattleArena;
|
|
KHash< int, hashPr_string> m_hashBattleArenaId;
|
|
};
|
|
|
|
SBattleArenaDB & GetBattleArenaDB();
|
|
|
|
#endif |