Public Member Functions | Private Member Functions | Private Attributes

unit_creator Class Reference

#include <actions.hpp>

Collaboration diagram for unit_creator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 unit_creator (team &tm, const map_location &start_pos)
unit_creatorallow_show (bool b)
unit_creatorallow_get_village (bool b)
unit_creatorallow_rename_side (bool b)
unit_creatorallow_invalidate (bool b)
unit_creatorallow_discover (bool b)
unit_creatorallow_add_to_recall (bool b)
map_location find_location (const config &cfg, const unit *pass_check=NULL)
 finds a suitable location for unit
void add_unit (const config &cfg, const vconfig *vcfg=NULL)
 adds a unit on map without firing any events (so, usable during team construction in gamestatus)

Private Member Functions

void post_create (const map_location &loc, const unit &new_unit, bool anim)

Private Attributes

bool add_to_recall_
bool discover_
bool get_village_
bool invalidate_
bool rename_side_
bool show_
const map_location start_pos_
teamteam_

Detailed Description

Definition at line 33 of file actions.hpp.


Constructor & Destructor Documentation

unit_creator::unit_creator ( team tm,
const map_location start_pos 
)

Definition at line 150 of file actions.cpp.


Member Function Documentation

void unit_creator::add_unit ( const config cfg,
const vconfig vcfg = NULL 
)

adds a unit on map without firing any events (so, usable during team construction in gamestatus)

Definition at line 246 of file actions.cpp.

References unit_map::add(), add_to_recall_, DBG_NG, preferences::encountered_units(), erase_if_matches_id(), gui2::event::find(), find_if_matches_id(), find_location(), config::get(), LOG_NG, post_create(), team::recall_list(), config::remove_attribute(), unit::side(), team::side(), resources::state_of_game, team_, unit::type_id(), resources::units, and map_location::valid().

Referenced by WML_HANDLER_FUNCTION().

Here is the call graph for this function:

Here is the caller graph for this function:

unit_creator & unit_creator::allow_add_to_recall ( bool  b  ) 

Definition at line 190 of file actions.cpp.

References add_to_recall_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

unit_creator & unit_creator::allow_discover ( bool  b  ) 

Definition at line 183 of file actions.cpp.

References discover_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

unit_creator & unit_creator::allow_get_village ( bool  b  ) 

Definition at line 163 of file actions.cpp.

References get_village_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

unit_creator & unit_creator::allow_invalidate ( bool  b  ) 

Definition at line 176 of file actions.cpp.

References invalidate_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

unit_creator & unit_creator::allow_rename_side ( bool  b  ) 

Definition at line 170 of file actions.cpp.

References rename_side_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

unit_creator & unit_creator::allow_show ( bool  b  ) 

Definition at line 156 of file actions.cpp.

References show_.

Referenced by WML_HANDLER_FUNCTION().

Here is the caller graph for this function:

map_location unit_creator::find_location ( const config cfg,
const unit pass_check = NULL 
)

finds a suitable location for unit

Return values:
map_location::null_location if unit is to be put into recall list
valid on-board map location otherwise

Definition at line 197 of file actions.cpp.

References DBG_NG, unit_map::find_leader(), pathfind::find_vacant_tile(), resources::game_map, map_location::null_location, gamemap::on_board(), team::side(), utils::split(), start_pos_, resources::state_of_game, team_, resources::units, pathfind::VACANT_ANY, map_location::valid(), and unit_map::iterator_base< iter_types >::valid().

Referenced by add_unit().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_creator::post_create ( const map_location loc,
const unit new_unit,
bool  anim 
) [private]

Definition at line 297 of file actions.cpp.

References discover_, display::draw(), preferences::encountered_units(), resources::game_map, get_village(), get_village_, display::invalidate(), invalidate_, resources::screen, gui2::tip::show(), show_, unit::side(), unit::type_id(), and unit_display::unit_recruited().

Referenced by add_unit().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 59 of file actions.hpp.

Referenced by add_unit(), and allow_add_to_recall().

bool unit_creator::discover_ [private]

Definition at line 60 of file actions.hpp.

Referenced by allow_discover(), and post_create().

Definition at line 61 of file actions.hpp.

Referenced by allow_get_village(), and post_create().

bool unit_creator::invalidate_ [private]

Definition at line 62 of file actions.hpp.

Referenced by allow_invalidate(), and post_create().

Definition at line 63 of file actions.hpp.

Referenced by allow_rename_side().

bool unit_creator::show_ [private]

Definition at line 64 of file actions.hpp.

Referenced by allow_show(), and post_create().

Definition at line 65 of file actions.hpp.

Referenced by find_location().

Definition at line 66 of file actions.hpp.

Referenced by add_unit(), and find_location().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:17:30 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs