mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 19:12:06 +00:00
Tweak some typedefs to make unit_abilities::effect easier to work with.
This commit is contained in:
parent
e7e7f68722
commit
127b8ba098
@ -128,8 +128,8 @@ void calculate_healing(int side, bool update_display)
|
||||
unit_abilities::effect heal_effect(heal,0,false);
|
||||
healing = heal_effect.get_composite_value();
|
||||
|
||||
for(std::vector<unit_abilities::individual_effect>::const_iterator heal_loc = heal_effect.begin(); heal_loc != heal_effect.end(); ++heal_loc) {
|
||||
healers.push_back(&*units.find(heal_loc->loc));
|
||||
BOOST_FOREACH (const unit_abilities::individual_effect &heal_loc, heal_effect ) {
|
||||
healers.push_back(&*units.find(heal_loc.loc));
|
||||
}
|
||||
|
||||
if (!healers.empty()) {
|
||||
|
@ -162,7 +162,7 @@ void battle_prediction_pane::get_unit_strings(const battle_context_unit_stats& s
|
||||
|
||||
// Get the SET damage modifier, if any.
|
||||
const unit_abilities::individual_effect *set_dmg_effect = NULL;
|
||||
unit_abilities::effect_list::const_iterator i;
|
||||
unit_abilities::effect::const_iterator i;
|
||||
for(i = dmg_effect.begin(); i != dmg_effect.end(); ++i) {
|
||||
if(i->type == unit_abilities::SET) {
|
||||
set_dmg_effect = &*i;
|
||||
|
@ -39,21 +39,23 @@ struct individual_effect
|
||||
map_location loc;
|
||||
};
|
||||
|
||||
typedef std::vector<individual_effect> effect_list;
|
||||
|
||||
class effect
|
||||
{
|
||||
public:
|
||||
effect(const unit_ability_list& list, int def, bool backstab);
|
||||
|
||||
// Provide read-only access to the effect list:
|
||||
typedef std::vector<individual_effect>::const_iterator iterator;
|
||||
typedef std::vector<individual_effect>::const_iterator const_iterator;
|
||||
|
||||
int get_composite_value() const
|
||||
{ return composite_value_; }
|
||||
effect_list::const_iterator begin() const
|
||||
const_iterator begin() const
|
||||
{ return effect_list_.begin(); }
|
||||
effect_list::const_iterator end() const
|
||||
const_iterator end() const
|
||||
{ return effect_list_.end(); }
|
||||
private:
|
||||
effect_list effect_list_;
|
||||
std::vector<individual_effect> effect_list_;
|
||||
int composite_value_;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user