The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
unit_creator Class Reference

#include <unit_creator.hpp>

Public Member Functions

 unit_creator (team &tm, const map_location &start_pos, game_board *board=nullptr)
 
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=nullptr)
 finds a suitable location for unit More...
 
void add_unit (const config &cfg, const vconfig *vcfg=nullptr)
 adds a unit on map without firing any events (so, usable during team construction in gamestatus) More...
 

Private Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 32 of file unit_creator.hpp.

Constructor & Destructor Documentation

◆ unit_creator()

unit_creator::unit_creator ( team tm,
const map_location start_pos,
game_board board = nullptr 
)

Definition at line 47 of file unit_creator.cpp.

Member Function Documentation

◆ add_unit()

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

◆ allow_add_to_recall()

unit_creator & unit_creator::allow_add_to_recall ( bool  b)

Definition at line 95 of file unit_creator.cpp.

References add_to_recall_, and b.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ allow_discover()

unit_creator & unit_creator::allow_discover ( bool  b)

Definition at line 88 of file unit_creator.cpp.

References b, and discover_.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ allow_get_village()

unit_creator & unit_creator::allow_get_village ( bool  b)

Definition at line 68 of file unit_creator.cpp.

References b, and get_village_.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ allow_invalidate()

unit_creator & unit_creator::allow_invalidate ( bool  b)

Definition at line 81 of file unit_creator.cpp.

References b, and invalidate_.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ allow_rename_side()

unit_creator & unit_creator::allow_rename_side ( bool  b)

Definition at line 75 of file unit_creator.cpp.

References b, and rename_side_.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ allow_show()

unit_creator & unit_creator::allow_show ( bool  b)

Definition at line 61 of file unit_creator.cpp.

References b, and show_.

Referenced by team_builder::place_units(), and game_events::WML_HANDLER_FUNCTION().

◆ find_location()

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

◆ post_create()

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

Member Data Documentation

◆ add_to_recall_

bool unit_creator::add_to_recall_
private

Definition at line 59 of file unit_creator.hpp.

Referenced by add_unit(), and allow_add_to_recall().

◆ board_

game_board* unit_creator::board_
private

Definition at line 67 of file unit_creator.hpp.

Referenced by add_unit(), find_location(), and post_create().

◆ discover_

bool unit_creator::discover_
private

Definition at line 60 of file unit_creator.hpp.

Referenced by allow_discover(), and post_create().

◆ get_village_

bool unit_creator::get_village_
private

Definition at line 61 of file unit_creator.hpp.

Referenced by allow_get_village(), and post_create().

◆ invalidate_

bool unit_creator::invalidate_
private

Definition at line 62 of file unit_creator.hpp.

Referenced by allow_invalidate(), and post_create().

◆ rename_side_

bool unit_creator::rename_side_
private

Definition at line 63 of file unit_creator.hpp.

Referenced by allow_rename_side().

◆ show_

bool unit_creator::show_
private

Definition at line 64 of file unit_creator.hpp.

Referenced by allow_show(), and post_create().

◆ start_pos_

const map_location unit_creator::start_pos_
private

Definition at line 65 of file unit_creator.hpp.

Referenced by find_location().

◆ team_

team& unit_creator::team_
private

Definition at line 66 of file unit_creator.hpp.

Referenced by add_unit(), and find_location().


The documentation for this class was generated from the following files: