00001 #ifndef HUNT_HH_ 00002 # define HUNT_HH_ 00003 00004 # include "task.hh" 00005 # include "objects_fwd.hh" 00006 # include "def_map.hh" 00007 00008 namespace tasks 00009 { 00010 class Hunt : public Task 00011 { 00012 public: 00013 enum State 00014 { 00015 state_moving, 00016 state_attacking, 00017 state_collecting_item 00018 }; 00019 00020 public: 00021 Hunt(const objects::DefMap &hunt_map, 00022 const objects::HuntCourse &hunt_course); 00023 ~Hunt(); 00024 00025 virtual void execute(); 00026 virtual void process(); 00027 virtual void terminate(); 00028 00029 virtual const std::string &get_name() const; 00030 00031 void set_current_node(const objects::MapNode &n); 00032 00033 protected: 00034 const objects::DefMap &_hunt_map; 00035 const objects::HuntCourse &_hunt_course; 00036 objects::HuntCourse::const_iterator _current_node; 00037 State _state; 00038 00039 virtual void require_sub_task(); 00040 00041 bool _terminating; 00042 00043 bool check_enemies(); 00044 bool check_items(); 00045 }; 00046 } 00047 00048 #endif