The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Typedefs | Enumerations | Functions
create.hpp File Reference

Various functions related to the creation of units (recruits, recalls, and placed units). More...

#include "unit_creator.hpp"
#include "map/location.hpp"
#include "units/ptr.hpp"
#include <tuple>
Include dependency graph for create.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 actions
 

Typedefs

typedef std::tuple< bool, int,
bool > 
actions::place_recruit_result
 

Enumerations

enum  actions::RECRUIT_CHECK {
  actions::RECRUIT_NO_LEADER, actions::RECRUIT_NO_ABLE_LEADER, actions::RECRUIT_NO_KEEP_LEADER, actions::RECRUIT_NO_VACANCY,
  actions::RECRUIT_ALTERNATE_LOCATION, actions::RECRUIT_OK
}
 The possible results of finding a location for recruiting (or recalling). More...
 

Functions

RECRUIT_CHECK actions::check_recruit_location (const int side, map_location &recruit_location, map_location &recruited_from, const std::string &unit_type)
 Checks if there is a location on which to place a recruited unit. More...
 
std::string actions::find_recruit_location (const int side, map_location &recruit_location, map_location &recruited_from, const std::string &unit_type)
 Finds a location on which to place a unit. More...
 
RECRUIT_CHECK actions::check_recall_location (const int side, map_location &recall_location, map_location &recall_from, const unit &unit_recall)
 Checks if there is a location on which to recall unit_recall. More...
 
std::string actions::find_recall_location (const int side, map_location &recall_location, map_location &recall_from, const unit &unit_recall)
 Finds a location on which to recall unit_recall. More...
 
const std::set< std::string > actions::get_recruits (int side, const map_location &recruit_location)
 Gets the recruitable units from a side's leaders' personal recruit lists who can recruit on or from a specific hex field. More...
 
std::vector< unit_const_ptractions::get_recalls (int side, const map_location &recall_loc)
 Gets the recallable units for a side, restricted by that side's leaders' personal abilities to recall on or from a specific hex field. More...
 
place_recruit_result actions::place_recruit (unit_ptr u, const map_location &recruit_location, const map_location &recruited_from, int cost, bool is_recall, map_location::DIRECTION facing=map_location::NDIRECTIONS, bool show=false, bool fire_event=true, bool full_movement=false, bool wml_triggered=false)
 Place a unit into the game. More...
 
void actions::recruit_unit (const unit_type &u_type, int side_num, const map_location &loc, const map_location &from, bool show, bool use_undo)
 Recruits a unit of the given type for the given side. More...
 
bool actions::recall_unit (const std::string &id, team &current_team, const map_location &loc, const map_location &from, map_location::DIRECTION facing, bool show, bool use_undo)
 Recalls the unit with the indicated ID for the provided team. More...
 

Detailed Description

Various functions related to the creation of units (recruits, recalls, and placed units).

Definition in file create.hpp.