00001 /* $Id: unit_helper.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2003 - 2012 by David White <dave@whitevine.net> 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY. 00012 00013 See the COPYING file for more details. 00014 */ 00015 00016 /** @file */ 00017 00018 #ifndef UNIT_HELPER_HPP_INCLUDED 00019 #define UNIT_HELPER_HPP_INCLUDED 00020 00021 #include "unit_map.hpp" 00022 00023 namespace unit_helper { 00024 00025 /** 00026 * Encapsulates the logic for deciding whether an iterator @a u points to 00027 * a unit that can advance. 00028 * @return true if the unit exists, has available advances, and can_advance(). 00029 */ 00030 bool will_certainly_advance(const unit_map::iterator &u); 00031 00032 /** 00033 * Determines the total number of available advancements (of any kind) for 00034 * a given unit. This includes normal advances and modifiers. 00035 * @return the total number of possible advancements. 00036 */ 00037 int number_of_possible_advances(const unit &unit); 00038 00039 } 00040 00041 #endif
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:03:14 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |