00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef UNIT_ABILITIES_HPP_INCLUDED
00018 #define UNIT_ABILITIES_HPP_INCLUDED
00019
00020 #include "map.hpp"
00021
00022 class unit_ability_list;
00023
00024 namespace unit_abilities
00025 {
00026
00027
00028 enum value_modifier {NOT_USED,SET,ADD,MUL};
00029
00030 struct individual_effect
00031 {
00032 individual_effect() : type(NOT_USED), value(0), ability(NULL),
00033 loc(gamemap::location::null_location) {};
00034 individual_effect(value_modifier t,int val,config* abil,const gamemap::location& l);
00035 void set(value_modifier t,int val,config* abil,const gamemap::location& l);
00036 value_modifier type;
00037 int value;
00038 config* ability;
00039 gamemap::location loc;
00040 };
00041
00042 typedef std::vector<individual_effect> effect_list;
00043
00044 class effect
00045 {
00046 public:
00047 effect(const unit_ability_list& list, int def, bool backstab);
00048
00049 int get_composite_value() const
00050 { return composite_value_; }
00051 effect_list::const_iterator begin() const
00052 { return effect_list_.begin(); }
00053 effect_list::const_iterator end() const
00054 { return effect_list_.end(); }
00055 private:
00056 effect_list effect_list_;
00057 int composite_value_;
00058 };
00059
00060
00061 }
00062
00063
00064 #endif
00065