20 #ifndef UNIT_DISPLAY_HPP_INCLUDED
21 #define UNIT_DISPLAY_HPP_INCLUDED
49 explicit unit_mover(
const std::vector<map_location>&
path,
bool animate=
true,
bool force_scroll=
false);
69 const std::vector<map_location>&
path_;
83 bool force_scroll=
false);
105 unit* winner=
nullptr);
120 int swing,
std::string hit_text,
int drain_amount,
std::string att_text,
const std::vector<std::string>* extra_hit_sounds=
nullptr);
129 void unit_healing(
unit &healed,
const std::vector<unit *> &healers,
int healing,
game_display *const disp_
void unit_attack(display *disp, game_board &board, const map_location &a, const map_location &b, int damage, const attack_type &attack, const attack_type *secondary_attack, int swing, std::string hit_text, int drain_amount, std::string att_text, const std::vector< std::string > *extra_hit_sounds)
Make the unit on tile 'a' attack the unit on tile 'b'.
Manages a list of fake units for the display object.
void wml_animation(const vconfig &cfg, const map_location &default_location)
Parse a standard WML for animations and play the corresponding animation.
Contains a number of free functions which display units.
GLdouble GLdouble GLdouble b
unit_ptr shown_unit_
The animation potential to wait until. INT_MIN for no wait; INT_MAX to wait for end.
unit_mover(const std::vector< map_location > &path, bool animate=true, bool force_scroll=false)
The path must remain unchanged for the life of this object.
GLsizei const char ** path
void finish(unit_ptr u, map_location::DIRECTION dir=map_location::NDIRECTIONS)
Finishes the display of movement for the supplied unit.
void proceed_to(unit_ptr u, 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 update_shown_unit()
Switches the display back to *shown_unit_ after animating.
GLboolean GLboolean GLboolean GLboolean a
A class to encapsulate the steps of drawing a unit's move.
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.
const std::vector< map_location > & path_
The unit to be (re-)shown after an animation finishes.
void wait_for_anims()
Waits for the final animation of the most recent proceed_to() to finish.
static const map_location & null_location()
void unit_draw_weapon(const map_location &loc, unit &attacker, const attack_type *attack, const attack_type *secondary_attack, const map_location &defender_loc, unit *defender)
Play a pre-fight animation First unit is the attacker, second unit the defender.
Encapsulates the map of the game.
void unit_die(const map_location &loc, unit &loser, const attack_type *attack, const attack_type *secondary_attack, const map_location &winner_loc, unit *winner)
Show a unit fading out.
void replace_temporary(unit_ptr u)
Makes the temporary unit used by this match the supplied unit.
void start(unit_ptr u)
Initiates the display of movement for the supplied unit.
DIRECTION
Valid directions which can be moved in our hexagonal world.
void unit_sheath_weapon(const map_location &primary_loc, unit *primary_unit, const attack_type *primary_attack, const attack_type *secondary_attack, const map_location &secondary_loc, unit *secondary_unit)
Play a post-fight animation Both unit can be set to null, only valid units will play their animation...
void unit_recruited(const map_location &loc, const map_location &leader_loc)
A variable-expanding proxy for the config class.
fake_unit_ptr temp_unit_ptr_
GLsizei const GLcharARB ** string
Holds a temporary unit that can be drawn on the map without being placed in the unit_map.
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.