The Battle for Wesnoth  1.19.0-dev
Classes | Namespaces | Typedefs | Functions
utility.hpp File Reference
#include <vector>
#include <deque>
#include <functional>
#include "typedefs.hpp"
Include dependency graph for utility.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wb::temporary_unit_hider
 
class  wb::variable_finalizer< T >
 Finalizer class to help with exception safety sets variable to value on destruction. More...
 

Namespaces

 wb
 

Typedefs

typedef std::function< bool(team &)> wb::team_filter
 Callable object class to filter teams. More...
 

Functions

std::size_t wb::viewer_team ()
 
int wb::viewer_side ()
 
side_actions_ptr wb::viewer_actions ()
 
side_actions_ptr wb::current_side_actions ()
 
unit_const_ptr wb::find_backup_leader (const unit &leader)
 For a given leader on a keep, find another leader on another keep in the same castle. More...
 
unitwb::find_recruiter (std::size_t team_index, const map_location &hex)
 
bool wb::any_recruiter (int side_num, const map_location &loc, std::function< bool(unit &)> func)
 executes func for each unti of side of side_num that can recruit on loc. More...
 
unitwb::future_visible_unit (map_location hex, int viewer_side=wb::viewer_side())
 Applies the future unit map and. More...
 
unitwb::future_visible_unit (int on_side, map_location hex, int viewer_side=wb::viewer_side())
 Applies the future unit map and. More...
 
int wb::path_cost (const std::vector< map_location > &path, const unit &u)
 Computes the MP cost for u to travel path. More...
 
void wb::ghost_owner_unit (unit *unit)
 
void wb::unghost_owner_unit (unit *unit)
 
bool wb::has_actions ()
 Return whether the whiteboard has actions. More...
 
bool wb::team_has_visible_plan (team &)
 Returns whether a given team's plan is visible. More...
 
void wb::for_each_action (std::function< void(action *)> function, team_filter team_filter=team_has_visible_plan)
 Apply a function to all the actions of the whiteboard. More...
 
action_ptr wb::find_action_at (map_location hex, team_filter team_filter=team_has_visible_plan)
 Find the first action occurring on a given hex. More...
 
std::deque< action_ptr > wb::find_actions_of (const unit &target)
 Find the actions of an unit. More...