00001 #ifndef ITEM_SUPPLY_HH_ 00002 # define ITEM_SUPPLY_HH_ 00003 00004 # include <set> 00005 00006 # include "task.hh" 00007 # include "objects_fwd.hh" 00008 # include "def_map.hh" 00009 00010 namespace tasks 00011 { 00012 class ItemSupply : public Task 00013 { 00014 public: 00015 enum State 00016 { 00017 state_going_to_shop, 00018 state_arranging_items, 00019 state_supply, 00020 state_arranging_new_items, 00021 state_finishing 00022 }; 00023 00024 public: 00025 ItemSupply(); 00026 ~ItemSupply(); 00027 00028 virtual void execute(); 00029 virtual void process(); 00030 virtual void terminate(); 00031 00032 virtual const std::string &get_name() const; 00033 00034 protected: 00035 State _state; 00036 00037 int _stat_money_before; 00038 int _stat_hp_healed; 00039 int _stat_mp_healed; 00040 int _stat_hp_attempted_to_buy; 00041 int _stat_mp_attempted_to_buy; 00042 int _stat_items_sold; 00043 int _stat_earned_by_selling; 00044 int _stat_balance; 00045 const objects::HealingItem *_stat_hp_healing_item; 00046 const objects::HealingItem *_stat_mp_healing_item; 00047 00048 virtual void require_sub_task(); 00049 00050 void sell(); 00051 void arrange(); 00052 void supply(); 00053 }; 00054 } 00055 00056 #endif