The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
abilities.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2006 - 2016 by Dominic Bolin <[email protected]>
3  Part of the Battle for Wesnoth Project http://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 #ifndef UNIT_ABILITIES_HPP_INCLUDED
18 #define UNIT_ABILITIES_HPP_INCLUDED
19 
20 #include "map/location.hpp"
21 
22 class unit_ability_list;
23 
24 namespace unit_abilities
25 {
26 bool filter_base_matches(const config& cfg, int def);
27 
29 
31 {
33  loc(map_location::null_location()) {}
34  void set(value_modifier t, int val, const config *abil,const map_location &l);
36  int value;
37  const config *ability;
39 };
40 
41 class effect
42 {
43  public:
44  effect(const unit_ability_list& list, int def, bool backstab);
45 
46  // Provide read-only access to the effect list:
47  typedef std::vector<individual_effect>::const_iterator iterator;
48  typedef std::vector<individual_effect>::const_iterator const_iterator;
49 
50  int get_composite_value() const
51  { return composite_value_; }
52  const_iterator begin() const
53  { return effect_list_.begin(); }
54  const_iterator end() const
55  { return effect_list_.end(); }
56  private:
57  std::vector<individual_effect> effect_list_;
59 };
60 
61 
62 }
63 
64 
65 #endif
66 
const_iterator end() const
Definition: abilities.hpp:54
std::vector< individual_effect > effect_list_
Definition: abilities.hpp:57
std::vector< individual_effect >::const_iterator iterator
Definition: abilities.hpp:47
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1221
void set(value_modifier t, int val, const config *abil, const map_location &l)
Definition: abilities.cpp:984
GLuint const GLfloat * val
Definition: glew.h:2614
GLdouble GLdouble t
Definition: glew.h:1366
bool filter_base_matches(const config &cfg, int def)
Definition: abilities.cpp:992
GLdouble l
Definition: glew.h:6966
GLsizei const GLfloat * value
Definition: glew.h:1817
effect(const unit_ability_list &list, int def, bool backstab)
Definition: abilities.cpp:1011
Encapsulates the map of the game.
Definition: location.hpp:38
const_iterator begin() const
Definition: abilities.hpp:52
int get_composite_value() const
Definition: abilities.hpp:50
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
std::vector< individual_effect >::const_iterator const_iterator
Definition: abilities.hpp:48