17 #ifndef UNIT_ANIM_COMP_HPP
18 #define UNIT_ANIM_COMP_HPP
23 #include <boost/scoped_ptr.hpp>
115 boost::scoped_ptr<unit_animation>
anim_;
bool refreshing_
avoid infinite recursion. flag used for drawing / animation
const unit & u_
A reference to the unit that owns this object.
void set_disabled_ghosted(bool with_bars=true)
Whiteboard related somehow.
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.
int frame_begin_time_
time for the frame to begin
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.
unit_animation * get_animation() const
Get a pointer to the current animation.
STATE state_
animation state
bool invalidate(const display &disp)
Invalidates an animation with respect to a display object, preparing it for redraw.
static const map_location & null_location()
boost::scoped_ptr< unit_animation > anim_
The current animation.
STATE
States for animation.
Encapsulates the map of the game.
void set_idling()
Sets the animation state to idling.
void start_animation(int start_time, const unit_animation *animation, bool with_bars, const std::string &text="", Uint32 text_color=0, STATE state=STATE_ANIM)
Begin an animation.
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.
const unit_animation * choose_animation(const display &disp, const map_location &loc, const std::string &event, const map_location &second_loc=map_location::null_location(), const int damage=0, const unit_animation::hit_type hit_type=unit_animation::INVALID, const attack_type *attack=nullptr, const attack_type *second_attack=nullptr, int swing_num=0)
Chooses an appropriate animation from the list of known animations.
unit_animation_component(unit &my_unit)
normal anims
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.
GLsizei const GLcharARB ** string
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