The Battle for Wesnoth  1.15.1+dev
abilities.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 - 2018 by Dominic Bolin <dominic.bolin@exong.net>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /** @file */
16 
17 #pragma once
18 
19 #include "map/location.hpp"
20 
21 class unit_ability_list;
22 
23 namespace unit_abilities
24 {
25 bool filter_base_matches(const config& cfg, int def);
26 
28 
30 {
32  loc(map_location::null_location()) {}
33  void set(value_modifier t, int val, const config *abil,const map_location &l);
35  int value;
36  const config *ability;
38 };
39 
40 class effect
41 {
42  public:
43  effect(const unit_ability_list& list, int def, bool backstab);
44 
45  // Provide read-only access to the effect list:
46  typedef std::vector<individual_effect>::const_iterator iterator;
47  typedef std::vector<individual_effect>::const_iterator const_iterator;
48 
49  int get_composite_value() const
50  { return composite_value_; }
51  const_iterator begin() const
52  { return effect_list_.begin(); }
53  const_iterator end() const
54  { return effect_list_.end(); }
55  private:
56  std::vector<individual_effect> effect_list_;
58 };
59 
60 
61 }
std::vector< individual_effect > effect_list_
Definition: abilities.hpp:56
std::vector< individual_effect >::const_iterator iterator
Definition: abilities.hpp:46
const_iterator end() const
Definition: abilities.hpp:53
bool filter_base_matches(const config &cfg, int def)
Definition: abilities.cpp:1198
const_iterator begin() const
Definition: abilities.hpp:51
Encapsulates the map of the game.
Definition: location.hpp:42
int get_composite_value() const
Definition: abilities.hpp:49
double t
Definition: astarsearch.cpp:64
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:92
std::vector< individual_effect >::const_iterator const_iterator
Definition: abilities.hpp:47