00001 #ifndef DEF_MAP_HH_ 00002 # define DEF_MAP_HH_ 00003 00004 # include <vector> 00005 # include <list> 00006 # include <map> 00007 00008 # include "objects_fwd.hh" 00009 # include "language.hh" 00010 00011 namespace objects 00012 { 00013 class HuntCourse : public std::list<MapNode *> 00014 { 00015 public: 00016 HuntCourse(std::string course_name, int level_required = 0, 00017 int experience_worth = 0, int money_worth = 0); 00018 ~HuntCourse(); 00019 00020 int get_level_required() const; 00021 int get_experience_worth() const; 00022 int get_money_worth() const; 00023 00024 HuntCourse &add_node(int x, int y, int z); 00025 HuntCourse &add_node(MapNode &mn); 00026 const MapNode &get_closest_node() const; 00027 00028 const std::string &get_course_name() const; 00029 00030 protected: 00031 int _level_required; 00032 int _experience_worth; 00033 int _money_worth; 00034 std::string _course_name; 00035 }; 00036 00037 class WarpPoint 00038 { 00039 public: 00040 WarpPoint(int id, const MapNode &warp_node, 00041 const DefMap &destination_map, int cost = 0); 00042 ~WarpPoint(); 00043 00044 int get_id() const; 00045 const MapNode &get_warp_node() const; 00046 const DefMap &get_destination_map() const; 00047 int get_cost() const; 00048 00049 protected: 00050 int _id; 00051 const MapNode &_warp_node; 00052 const DefMap &_destination_map; 00053 int _cost; 00054 }; 00055 00056 class DefMap : public language::Namable 00057 { 00058 public: 00059 typedef std::vector<MapNode *> MapNodes; 00060 typedef std::list<HuntCourse> HuntCourses; 00061 typedef std::map<int, WarpPoint> WarpPoints; 00062 typedef std::list<const DefMap *> MapList; 00063 00064 public: 00065 DefMap(); 00066 ~DefMap(); 00067 00068 virtual int get_id() const; 00069 00070 const MapNode *get_repair_node() const; 00071 const MapNode *get_supply_node() const; 00072 const MapNode *get_warehouse_node() const; 00073 const MapNode *get_gate_node() const; 00074 const HuntCourses &get_hunt_courses() const; 00075 bool is_home() const; 00076 00077 const WarpPoints &get_warp_points() const; 00078 virtual void load_warp_points() = 0; 00079 MapList find_path(const DefMap &dest) const; 00080 00081 protected: 00082 MapNodes _nodes; 00083 MapNode *_repair_node; 00084 MapNode *_supply_node; 00085 MapNode *_warehouse_node; 00086 MapNode *_gate_node; 00087 HuntCourses _hunt_courses; 00088 WarpPoints _warp_points; 00089 00090 bool _home; 00091 00092 int add_node(MapNode &node); 00093 void add_hunt_course(HuntCourse &hc); 00094 void add_warp_point(int id, const MapNode *warp_node, 00095 int destination_map_id, int cost = 0); 00096 }; 00097 } 00098 00099 # include "def_map.hxx" 00100 00101 #endif