Files
Leviathan/Client/Game/game/DB/SBattleArenaBeginAreaDB.h
T
2026-06-01 12:46:52 +02:00

78 lines
1.5 KiB
C++

#ifndef _BattleArenaBeginAreaDB_h_
#define _BattleArenaBeginAreaDB_h_
#include <toolkit/khash.h>
#include "K3DTypes.h"
struct sBattleArenaBeginArea
{
struct sTeamBeginArea
{
struct sPos
{
sPos(int x, int y) : m_x(x), m_y(y) {}
int m_x;
int m_y;
};
~sTeamBeginArea()
{
m_posList.clear();
}
void add(int x, int y)
{
m_posList.push_back(sPos(x, y));
}
void getPointList(std::vector<K3DVector2>& pointList)
{
std::vector<sPos>::iterator it = m_posList.begin();
for (; it != m_posList.end(); ++it)
{
pointList.push_back(K3DVector2((float)it->m_x, (float)it->m_y));
}
}
std::vector<sPos> m_posList;
};
/// teamNum 1: 연합군, 2: 마녀군
void add(int teamNum, int x, int y)
{
int index = teamNum == 1 ? 0 : 1;
m_teamBeginArea[index].add(x, y);
}
void getPointList(int teamNum, std::vector<K3DVector2>& pointList)
{
int index = teamNum == 1 ? 0 : 1;
m_teamBeginArea[index].getPointList(pointList);
}
int m_id;
sTeamBeginArea m_teamBeginArea[2];
};
class SBattleArenaBeginAreaDB
{
public:
SBattleArenaBeginAreaDB();
~SBattleArenaBeginAreaDB();
/// teamNum 1: 연합군, 2: 마녀군
void getPointList(int arenaId, int teamNum, std::vector<K3DVector2>& pointList);
private:
void Init();
void Destroy();
void Load();
private:
KHash< sBattleArenaBeginArea*, hashPr_mod_int> m_hashBattleArenaBeginArea;
public:
static SBattleArenaBeginAreaDB* m_pThis;
};
SBattleArenaBeginAreaDB & GetBattleArenaBeginAreaDB();
#endif