#ifndef __INC_METIN_II_GAME_SPEEDSERVER_H__ #define __INC_METIN_II_GAME_SPEEDSERVER_H__ #include #include // castle.cpp ¿¡ ÀÖ´Â °ÍÀ» º¹ºÙ ÇÏ¿´´Ù #define EMPIRE_NONE 0 // ¾Æ¹«±¹°¡ ¾Æ´Ô #define EMPIRE_RED 1 // ½Å¼ö #define EMPIRE_YELLOW 2 // õÁ¶ #define EMPIRE_BLUE 3 // Áø³ë class HME { public : int hour; int min; int exp; HME (int h=0, int m=0, int e=0){ hour = h; min = m; exp = e; } HME& operator=(const HME &rhs) { hour = rhs.hour; min = rhs.min; exp = rhs.exp; return *this; } bool operator==(const HME &rhs) const { return hour == rhs.hour && min == rhs.min && exp == rhs.exp; } bool operator<(const HME &rhs) const { return (hour& GetWdayExpTable(int wday); void SetWdayExpTable(int wday, HME hme); std::list & GetHolidayExpTable(Date date, bool &is_exist); void SetHolidayExpTable(Date date, HME hme); void InitWdayExpTable(int wday); void InitHolidayExpTable(Date date); HME GetCurrentExpPriv (int &duration, bool &is_change); bool WriteExpTable(); private : bool LoadExpTable (); bool LoadWdayExpTable (int wday, char *str); BYTE empire; char file_name [256]; HME current_hme; std::map > holiday_map; std::list wday_exp_table[7]; }; class CSpeedServerManager : public singleton { public: CSpeedServerManager(); ~CSpeedServerManager(); bool Initialize (); std::list & GetWdayExpTableOfEmpire (BYTE empire, int wday); void SetWdayExpTableOfEmpire (BYTE empire, int wday, HME hme); void InitWdayExpTableOfEmpire (BYTE empire, int wday); std::list & GetHolidayExpTableOfEmpire (BYTE empire, Date date, bool &is_exist); void SetHolidayExpTableOfEmpire (BYTE empire, Date date, HME hme); void InitHolidayExpTableOfEmpire (BYTE empire, Date date); bool WriteExpTableOfEmpire (BYTE empire); HME GetCurrentExpPrivOfEmpire (BYTE empire, int &duration, bool &is_change); private: CSpeedServerEmpireExp Empire[EMPIRE_MAX_NUM]; }; #endif