#ifndef _BattleArenaBeginAreaDB_h_ #define _BattleArenaBeginAreaDB_h_ #include #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& pointList) { std::vector::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 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& 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& pointList); private: void Init(); void Destroy(); void Load(); private: KHash< sBattleArenaBeginArea*, hashPr_mod_int> m_hashBattleArenaBeginArea; public: static SBattleArenaBeginAreaDB* m_pThis; }; SBattleArenaBeginAreaDB & GetBattleArenaBeginAreaDB(); #endif