Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends

unit_animation Class Reference

#include <unit_animation.hpp>

Collaboration diagram for unit_animation:
Collaboration graph
[legend]

List of all members.

Classes

class  particule

Public Types

enum  variation_type { MATCH_FAIL = -10, DEFAULT_ANIM = -9 }
enum  hit_type { HIT, MISS, KILL, INVALID }

Public Member Functions

int matches (const game_display &disp, const map_location &loc, const map_location &second_loc, const unit *my_unit, const std::string &event="", const int value=0, hit_type hit=INVALID, const attack_type *attack=NULL, const attack_type *second_attack=NULL, int value2=0) const
const unit_frameget_last_frame () const
void add_frame (int duration, const unit_frame &value, bool force_change=false)
bool need_update () const
bool need_minimal_update () const
bool animation_finished () const
bool animation_finished_potential () const
void update_last_draw_time ()
int get_begin_time () const
int get_end_time () const
int time_to_tick (int animation_time) const
int get_animation_time () const
int get_animation_time_potential () const
void start_animation (int start_time, const map_location &src=map_location::null_location, const map_location &dst=map_location::null_location, const std::string &text="", const Uint32 text_color=0, const bool accelerate=true)
void update_parameters (const map_location &src, const map_location &dst)
void pause_animation ()
void restart_animation ()
int get_current_frame_begin_time () const
void redraw (frame_parameters &value)
void clear_haloes ()
bool invalidate (frame_parameters &value)
 unit_animation (const config &cfg, const std::string &frame_string="")

Static Public Member Functions

static const std::vector
< std::string > & 
all_tag_names ()
static void fill_initial_animations (std::vector< unit_animation > &animations, const config &cfg)
static void add_anims (std::vector< unit_animation > &animations, const config &cfg)

Protected Member Functions

const frame_parameters get_current_params (const frame_parameters &default_val=frame_parameters()) const

Private Member Functions

 unit_animation ()
 Shouldn't be used so only declared.
 unit_animation (int start_time, const unit_frame &frame, const std::string &event="", const int variation=DEFAULT_ANIM, const frame_builder &builder=frame_builder())

Private Attributes

t_translation::t_list terrain_types_
std::vector< configunit_filter_
std::vector< configsecondary_unit_filter_
std::vector
< map_location::DIRECTION
directions_
int frequency_
int base_score_
std::vector< std::string > event_
std::vector< int > value_
std::vector< configprimary_attack_filter_
std::vector< configsecondary_attack_filter_
std::vector< hit_typehits_
std::vector< int > value2_
std::map< std::string, particulesub_anims_
particule unit_anim_
map_location src_
map_location dst_
bool invalidated_
bool play_offscreen_
std::set< map_locationoverlaped_hex_

Friends

class unit

Detailed Description

Definition at line 26 of file unit_animation.hpp.


Member Enumeration Documentation

Enumerator:
HIT 
MISS 
KILL 
INVALID 

Definition at line 32 of file unit_animation.hpp.

Enumerator:
MATCH_FAIL 
DEFAULT_ANIM 

Definition at line 31 of file unit_animation.hpp.


Constructor & Destructor Documentation

unit_animation::unit_animation (  )  [private]

Shouldn't be used so only declared.

Referenced by add_anims(), and fill_initial_animations().

Here is the caller graph for this function:

unit_animation::unit_animation ( const config cfg,
const std::string &  frame_string = "" 
) [explicit]
unit_animation::unit_animation ( int  start_time,
const unit_frame frame,
const std::string &  event = "",
const int  variation = DEFAULT_ANIM,
const frame_builder builder = frame_builder() 
) [explicit, private]

Definition at line 163 of file unit_animation.cpp.

References add_frame(), unit_frame::does_not_change(), and unit_frame::duration().

Here is the call graph for this function:


Member Function Documentation

void unit_animation::add_anims ( std::vector< unit_animation > &  animations,
const config cfg 
) [static]
void unit_animation::add_frame ( int  duration,
const unit_frame value,
bool  force_change = false 
) [inline]

Definition at line 42 of file unit_animation.hpp.

References animated< T, T_void_value >::add_frame(), and unit_anim_.

Referenced by unit_animation().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< std::string > & unit_animation::all_tag_names (  )  [static]

Definition at line 64 of file unit_animation.cpp.

Referenced by unit::unit().

Here is the caller graph for this function:

bool unit_animation::animation_finished (  )  const

Definition at line 787 of file unit_animation.cpp.

References animated< T, T_void_value >::animation_finished(), sub_anims_, and unit_anim_.

Here is the call graph for this function:

bool unit_animation::animation_finished_potential (  )  const

Definition at line 797 of file unit_animation.cpp.

References animated< T, T_void_value >::animation_finished_potential(), sub_anims_, and unit_anim_.

Referenced by unit::refresh(), and unit_animator::replace_anim_if_invalid().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_animation::clear_haloes (  ) 

Definition at line 897 of file unit_animation.cpp.

References unit_animation::particule::clear_halo(), sub_anims_, and unit_anim_.

Referenced by unit::clear_haloes().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_animation::fill_initial_animations ( std::vector< unit_animation > &  animations,
const config cfg 
) [static]
int unit_animation::get_animation_time (  )  const [inline]

Definition at line 52 of file unit_animation.hpp.

References animated< T, T_void_value >::get_animation_time(), and unit_anim_.

Here is the call graph for this function:

int unit_animation::get_animation_time_potential (  )  const [inline]

Definition at line 53 of file unit_animation.hpp.

References animated< T, T_void_value >::get_animation_time_potential(), and unit_anim_.

Here is the call graph for this function:

int unit_animation::get_begin_time (  )  const

Definition at line 827 of file unit_animation.cpp.

References animated< T, T_void_value >::get_begin_time(), sub_anims_, and unit_anim_.

Referenced by unit_animator::add_animation(), and unit::start_animation().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_animation::get_current_frame_begin_time (  )  const [inline]

Definition at line 63 of file unit_animation.hpp.

References animated< T, T_void_value >::get_current_frame_begin_time(), and unit_anim_.

Here is the call graph for this function:

const frame_parameters unit_animation::get_current_params ( const frame_parameters default_val = frame_parameters()  )  const [inline, protected]

Definition at line 74 of file unit_animation.hpp.

References unit_animation::particule::parameters(), and unit_anim_.

Referenced by unit::redraw_unit().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_animation::get_end_time (  )  const

Definition at line 817 of file unit_animation.cpp.

References animated< T, T_void_value >::get_end_time(), sub_anims_, and unit_anim_.

Here is the call graph for this function:

const unit_frame& unit_animation::get_last_frame (  )  const [inline]

Definition at line 41 of file unit_animation.hpp.

References animated< T, T_void_value >::get_last_frame(), and unit_anim_.

Here is the call graph for this function:

bool unit_animation::invalidate ( frame_parameters value  ) 
int unit_animation::matches ( const game_display disp,
const map_location loc,
const map_location second_loc,
const unit my_unit,
const std::string &  event = "",
const int  value = 0,
hit_type  hit = INVALID,
const attack_type attack = NULL,
const attack_type second_attack = NULL,
int  value2 = 0 
) const
bool unit_animation::need_minimal_update (  )  const

Definition at line 774 of file unit_animation.cpp.

References unit_animation::particule::need_minimal_update(), play_offscreen_, sub_anims_, and unit_anim_.

Referenced by invalidate().

Here is the call graph for this function:

Here is the caller graph for this function:

bool unit_animation::need_update (  )  const

Definition at line 764 of file unit_animation.cpp.

References unit_animation::particule::need_update(), sub_anims_, and unit_anim_.

Referenced by invalidate().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_animation::pause_animation (  ) 

Definition at line 866 of file unit_animation.cpp.

References animated< T, T_void_value >::pause_animation(), sub_anims_, and unit_anim_.

Here is the call graph for this function:

void unit_animation::redraw ( frame_parameters value  ) 

Definition at line 884 of file unit_animation.cpp.

References dst_, invalidated_, overlaped_hex_, frame_parameters::primary_frame, unit_animation::particule::redraw(), src_, sub_anims_, and unit_anim_.

Referenced by unit::redraw_unit().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_animation::restart_animation (  ) 

Definition at line 875 of file unit_animation.cpp.

References animated< T, T_void_value >::restart_animation(), sub_anims_, and unit_anim_.

Here is the call graph for this function:

void unit_animation::start_animation ( int  start_time,
const map_location src = map_location::null_location,
const map_location dst = map_location::null_location,
const std::string &  text = "",
const Uint32  text_color = 0,
const bool  accelerate = true 
)

Definition at line 837 of file unit_animation.cpp.

References unit_animation::particule::accelerate, animated< T, T_void_value >::add_frame(), dst_, src_, unit_animation::particule::start_animation(), sub_anims_, and unit_anim_.

Referenced by unit::start_animation().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_animation::time_to_tick ( int  animation_time  )  const [inline]

Definition at line 51 of file unit_animation.hpp.

References animated< T, T_void_value >::time_to_tick(), and unit_anim_.

Here is the call graph for this function:

void unit_animation::update_last_draw_time (  ) 

Definition at line 807 of file unit_animation.cpp.

References unit_animation::particule::accelerate, game_display::get_singleton(), sub_anims_, display::turbo_speed(), unit_anim_, and animated< T, T_void_value >::update_last_draw_time().

Referenced by unit::redraw_unit().

Here is the call graph for this function:

Here is the caller graph for this function:

void unit_animation::update_parameters ( const map_location src,
const map_location dst 
)

Definition at line 861 of file unit_animation.cpp.

References dst_, and src_.


Friends And Related Function Documentation

friend class unit [friend]

Definition at line 68 of file unit_animation.hpp.


Member Data Documentation

Definition at line 129 of file unit_animation.hpp.

Referenced by matches().

Definition at line 127 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 140 of file unit_animation.hpp.

Referenced by invalidate(), redraw(), start_animation(), and update_parameters().

std::vector<std::string> unit_animation::event_ [private]

Definition at line 130 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 128 of file unit_animation.hpp.

Referenced by matches().

std::vector<hit_type> unit_animation::hits_ [private]

Definition at line 134 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 142 of file unit_animation.hpp.

Referenced by invalidate(), and redraw().

Definition at line 144 of file unit_animation.hpp.

Referenced by invalidate(), and redraw().

Definition at line 143 of file unit_animation.hpp.

Referenced by need_minimal_update(), and unit_animation().

Definition at line 132 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 133 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 126 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 139 of file unit_animation.hpp.

Referenced by invalidate(), redraw(), start_animation(), and update_parameters().

std::map<std::string,particule> unit_animation::sub_anims_ [private]

Definition at line 124 of file unit_animation.hpp.

Referenced by matches().

std::vector<config> unit_animation::unit_filter_ [private]

Definition at line 125 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

std::vector<int> unit_animation::value2_ [private]

Definition at line 135 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

std::vector<int> unit_animation::value_ [private]

Definition at line 131 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu Feb 9 2012 01:08:14 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs