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 wait_for_anims()
Waits for the final animation of the most recent proceed_to() to finish.
void start(unit_ptr u)
Initiates the display of movement for the supplied unit.
void finish(unit_ptr u, map_location::direction dir=map_location::direction::indeterminate)
Finishes the display of movement for the supplied unit.
unit_ptr shown_unit_
The unit to be (re-)shown after an animation finishes.
void replace_temporary(unit_ptr u)
Makes the temporary unit used by this match the supplied unit.
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(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.
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_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 unit_draw_weapon(const map_location &loc, unit &attacker, const_attack_ptr attack, const_attack_ptr secondary_attack, const map_location &defender_loc, unit_ptr defender)
Play a pre-fight animation First unit is the attacker, second unit the defender.
void unit_die(const map_location &loc, unit &loser, const_attack_ptr attack, const_attack_ptr secondary_attack, const map_location &winner_loc, unit_ptr winner)
Show a unit fading out.
void unit_sheath_weapon(const map_location &primary_loc, unit_ptr primary_unit, const_attack_ptr primary_attack, const_attack_ptr secondary_attack, const map_location &secondary_loc, unit_ptr secondary_unit)
Play a post-fight animation Both unit can be set to null, only valid units will play their animation.
void unit_attack(display *disp, game_board &board, const map_location &a, const map_location &b, int damage, const attack_type &attack, 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 move_unit(const std::vector< map_location > &path, unit_ptr u, bool animate, map_location::direction dir, bool force_scroll)
Display a unit moving along a given path.
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()