87 bool with_bars,
const std::string &text =
"",
118 std::unique_ptr<unit_animation>
anim_;
void start_animation(int start_time, const unit_animation *animation, bool with_bars, const std::string &text="", color_t text_color={}, STATE state=STATE_ANIM)
Begin an animation.
bool refreshing_
avoid infinite recursion.
const unit & u_
A reference to the unit that owns this object.
This class represents a single unit of a specific type.
void set_disabled_ghosted(bool with_bars=true)
Whiteboard related somehow.
const unit_animation * choose_animation(const map_location &loc, const std::string &event, const map_location &second_loc=map_location::null_location(), const int damage=0, const strike_result::type hit_type=strike_result::type::invalid, const_attack_ptr attack=nullptr, const_attack_ptr second_attack=nullptr, int swing_num=0)
Chooses an appropriate animation from the list of known animations.
std::unique_ptr< unit_animation > anim_
The current animation.
void set_selecting()
Sets the animation state to that when the unit is selected.
animation will be automatically replaced by a standing anim when finished
bool draw_bars_
bool indicating whether to draw bars with the unit
void refresh()
Intermittently activates the idling animations in place of the standing animations.
unit_animation * get_animation() const
Get a pointer to the current animation.
int frame_begin_time_
time for the frame to begin
A single unit type that the player may recruit.
unit_animation_component(unit &my_unit, const unit_animation_component &o)
Copy construct a unit animation component, for use when copy constructing a unit. ...
void clear_haloes()
Clear the haloes associated to the unit.
The basic class for representing 8-bit RGB or RGBA colour values.
STATE state_
animation state
bool invalidate(const display &disp)
Invalidates an animation with respect to a display object, preparing it for redraw.
STATE
States for animation.
Encapsulates the map of the game.
void set_idling()
Sets the animation state to idling.
std::vector< std::string > get_flags()
Get the flags of all registered animations.
void apply_new_animation_effect(const config &effect)
Adds an animation described by a config.
std::vector< unit_animation > animations_
List of registered animations for this unit.
unit_animation_component(unit &my_unit)
normal anims
static const map_location & null_location()
halo::handle unit_halo_
handle to the halo of this unit
void set_standing(bool with_bars=true)
Sets the animation state to standing.
A config object defines a single node in a WML file, with access to child nodes.
std::shared_ptr< const attack_type > const_attack_ptr
std::shared_ptr< halo_record > handle
void set_ghosted(bool with_bars=true)
Sets the animation state to ghosted.
void reset_after_advance(const unit_type *newtype=nullptr)
Resets the animations list after the unit is advanced.
int next_idling_
time for next idle animation