50 explicit unit_mover(
const std::vector<map_location>&
path,
bool animate=
true,
bool force_scroll=
false);
72 const std::vector<map_location>&
path_;
86 bool force_scroll=
false);
120 int swing,
const std::string& hit_text,
int drain_amount,
const std::string& att_text,
const std::vector<std::string>* extra_hit_sounds=
nullptr,
121 bool attacking=
true);
130 void unit_healing(
unit &healed,
const std::vector<unit *> &healers,
int healing,
131 const std::string & extra_text=
"");
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
Holds a temporary unit that can be drawn on the map without being placed in the unit_map.
A class to encapsulate the steps of drawing a unit's move.
unit_mover & operator=(const unit_mover &)=delete
void finish(const unit_ptr &u, map_location::direction dir=map_location::direction::indeterminate)
Finishes the display of movement for the supplied unit.
void replace_temporary(const unit_ptr &u)
Makes the temporary unit used by this match the supplied unit.
void wait_for_anims()
Waits for the final animation of the most recent proceed_to() to finish.
unit_ptr shown_unit_
The unit to be (re-)shown after an animation finishes.
game_display *const disp_
void update_shown_unit()
Switches the display back to *shown_unit_ after animating.
std::chrono::milliseconds wait_until_
The animation potential to wait until.
void proceed_to(const unit_ptr &u, std::size_t path_index, bool update=false, bool wait=true)
Visually moves a unit from the last hex we drew to the one specified by path_index.
void start(const unit_ptr &u)
Initiates the display of movement for the supplied unit.
const std::vector< map_location > & path_
unit_mover(const unit_mover &)=delete
fake_unit_ptr temp_unit_ptr_
This class represents a single unit of a specific type.
Contains a number of free functions which display units.
void unit_die(const map_location &loc, unit &loser, const const_attack_ptr &attack, const const_attack_ptr &secondary_attack, const map_location &winner_loc, const unit_ptr &winner)
Show a unit fading out.
void unit_draw_weapon(const map_location &loc, unit &attacker, const const_attack_ptr &attack, const const_attack_ptr &secondary_attack, const map_location &defender_loc, const unit_ptr &defender)
Play a pre-fight animation First unit is the attacker, second unit the defender.
void unit_attack(display *disp, game_board &board, const map_location &a, const map_location &b, int damage, const attack_type &attack, const const_attack_ptr &secondary_attack, int swing, const std::string &hit_text, int drain_amount, const std::string &att_text, const std::vector< std::string > *extra_hit_sounds, bool attacking)
Make the unit on tile 'a' attack the unit on tile 'b'.
void unit_healing(unit &healed, const std::vector< unit * > &healers, int healing, const std::string &extra_text)
This will use a poisoning anim if healing<0.
void unit_recruited(const map_location &loc, const map_location &leader_loc)
void move_unit(const std::vector< map_location > &path, const unit_ptr &u, bool animate, map_location::direction dir, bool force_scroll)
Display a unit moving along a given path.
void unit_sheath_weapon(const map_location &primary_loc, const unit_ptr &primary_unit, const const_attack_ptr &primary_attack, const const_attack_ptr &secondary_attack, const map_location &secondary_loc, const unit_ptr &secondary_unit)
Play a post-fight animation Both unit can be set to null, only valid units will play their animation.
std::shared_ptr< const attack_type > const_attack_ptr
std::shared_ptr< unit > unit_ptr
Encapsulates the map of the game.
direction
Valid directions which can be moved in our hexagonal world.
static const map_location & null_location()