The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Attributes | List of all members
unit_animator Class Reference

#include <animation.hpp>

Classes

struct  anim_elem
 

Public Member Functions

 unit_animator ()
 
void add_animation (const unit *animated_unit, const unit_animation *animation, const map_location &src=map_location::null_location(), bool with_bars=false, const std::string &text="", const Uint32 text_color=0)
 
void add_animation (const unit *animated_unit, const std::string &event, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const int value=0, bool with_bars=false, const std::string &text="", const Uint32 text_color=0, const unit_animation::hit_type hit_type=unit_animation::INVALID, const attack_type *attack=nullptr, const attack_type *second_attack=nullptr, int value2=0)
 
void replace_anim_if_invalid (const unit *animated_unit, const std::string &event, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const int value=0, bool with_bars=false, const std::string &text="", const Uint32 text_color=0, const unit_animation::hit_type hit_type=unit_animation::INVALID, const attack_type *attack=nullptr, const attack_type *second_attack=nullptr, int value2=0)
 
void start_animations ()
 
void pause_animation ()
 
void restart_animation ()
 
void clear ()
 
void set_all_standing ()
 
bool would_end () const
 
int get_animation_time () const
 
int get_animation_time_potential () const
 
int get_end_time () const
 
void wait_for_end () const
 
void wait_until (int animation_time) const
 

Private Attributes

std::vector< anim_elemanimated_units_
 
int start_time_
 

Detailed Description

Definition at line 151 of file animation.hpp.

Constructor & Destructor Documentation

unit_animator::unit_animator ( )
inline

Definition at line 154 of file animation.hpp.

Member Function Documentation

void unit_animator::add_animation ( const unit animated_unit,
const unit_animation animation,
const map_location src = map_location::null_location(),
bool  with_bars = false,
const std::string text = "",
const Uint32  text_color = 0 
)
void unit_animator::add_animation ( const unit animated_unit,
const std::string event,
const map_location src = map_location::null_location(),
const map_location dst = map_location::null_location(),
const int  value = 0,
bool  with_bars = false,
const std::string text = "",
const Uint32  text_color = 0,
const unit_animation::hit_type  hit_type = unit_animation::INVALID,
const attack_type attack = nullptr,
const attack_type second_attack = nullptr,
int  value2 = 0 
)
void unit_animator::clear ( )
inline
int unit_animator::get_animation_time ( ) const

Definition at line 1416 of file animation.cpp.

Referenced by unit_display::unit_attack().

int unit_animator::get_animation_time_potential ( ) const

Definition at line 1420 of file animation.cpp.

Referenced by move_unit_between(), and unit_display::unit_attack().

int unit_animator::get_end_time ( ) const

Definition at line 1424 of file animation.cpp.

Referenced by unit_display::unit_attack().

void unit_animator::pause_animation ( )

Definition at line 1435 of file animation.cpp.

Referenced by move_unit_between().

void unit_animator::replace_anim_if_invalid ( const unit animated_unit,
const std::string event,
const map_location src = map_location::null_location(),
const map_location dst = map_location::null_location(),
const int  value = 0,
bool  with_bars = false,
const std::string text = "",
const Uint32  text_color = 0,
const unit_animation::hit_type  hit_type = unit_animation::INVALID,
const attack_type attack = nullptr,
const attack_type second_attack = nullptr,
int  value2 = 0 
)
void unit_animator::restart_animation ( )

Definition at line 1444 of file animation.cpp.

Referenced by move_unit_between().

void unit_animator::set_all_standing ( )
void unit_animator::start_animations ( )
void unit_animator::wait_for_end ( ) const
void unit_animator::wait_until ( int  animation_time) const
bool unit_animator::would_end ( ) const

Definition at line 1371 of file animation.cpp.

Referenced by unit_display::unit_attack().

Member Data Documentation

std::vector<anim_elem> unit_animator::animated_units_
private

Definition at line 226 of file animation.hpp.

Referenced by clear().

int unit_animator::start_time_
private

Definition at line 227 of file animation.hpp.

Referenced by clear().


The documentation for this class was generated from the following files: