The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
helper.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[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_HELPER_HPP_INCLUDED
18 #define UNIT_HELPER_HPP_INCLUDED
19 
20 #include "units/map.hpp"
21 
22 namespace unit_helper {
23 
24 /**
25  * Encapsulates the logic for deciding whether an iterator @a u points to
26  * a unit that can advance.
27  * @return true if the unit exists, has available advances, and can_advance().
28  */
30 
31 /**
32  * Determines the total number of available advancements (of any kind) for
33  * a given unit. This includes normal advances and modifiers.
34  * @return the total number of possible advancements.
35  */
37 
38 /**
39  * @return the name of the color encoding the weight of the unit's
40  * resistance value for presenting it to the player.
41  */
42 std::string resistance_color(const int resistance);
43 
44 }
45 
46 #endif
Definition: unit.hpp:95
bool will_certainly_advance(const unit_map::iterator &u)
Encapsulates the logic for deciding whether an iterator u points to a unit that can advance...
Definition: helper.cpp:31
std::string resistance_color(const int resistance)
Definition: helper.cpp:36
int number_of_possible_advances(const unit &u)
Determines the total number of available advancements (of any kind) for a given unit.
Definition: helper.cpp:26
GLsizei const GLcharARB ** string
Definition: glew.h:4503