unit_animation Class Reference

#include <unit_animation.hpp>

Collaboration diagram for unit_animation:

Collaboration graph
[legend]

List of all members.

Public Types

enum  variation_type { MATCH_FAIL = -2, DEFAULT_ANIM = -1 }
enum  hit_type { HIT, MISS, KILL, INVALID }

Public Member Functions

int matches (const game_display &disp, const gamemap::location &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 swing_num=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 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 gamemap::location &src=gamemap::location::null_location, const gamemap::location &dst=gamemap::location::null_location, bool cycles=false, const std::string text="", const Uint32 text_color=0, const bool accelerate=true)
void pause_animation ()
void restart_animation ()
int get_current_frame_begin_time () const
void redraw (const frame_parameters &value)
void invalidate (const frame_parameters &value) const

Static Public Member Functions

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(), bool primary=true) const

Private Member Functions

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

Static Private Member Functions

static config prepare_animation (const config &cfg, const std::string animation_tag)

Private Attributes

t_translation::t_list terrain_types_
std::vector< configunit_filter_
std::vector< configsecondary_unit_filter_
std::vector
< gamemap::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 > swing_num_
std::map< std::string, particulesub_anims_
particule unit_anim_

Friends

class unit

Classes

class  particule


Detailed Description

Definition at line 29 of file unit_animation.hpp.


Member Enumeration Documentation

Enumerator:
MATCH_FAIL 
DEFAULT_ANIM 

Definition at line 34 of file unit_animation.hpp.

Enumerator:
HIT 
MISS 
KILL 
INVALID 

Definition at line 35 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().

unit_animation::unit_animation ( const config cfg,
const std::string  frame_string = "" 
) [explicit, private]

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


Member Function Documentation

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

void unit_animation::add_anims ( std::vector< unit_animation > &  animations,
const config cfg 
) [static]

int unit_animation::matches ( const game_display disp,
const gamemap::location 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  swing_num = 0 
) const

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

Definition at line 42 of file unit_animation.hpp.

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

void unit_animation::add_frame ( int  duration,
const unit_frame value,
bool  force_change = false 
) [inline]

Definition at line 43 of file unit_animation.hpp.

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

Referenced by unit_animation().

bool unit_animation::need_update (  )  const

bool unit_animation::animation_finished (  )  const

bool unit_animation::animation_finished_potential (  )  const

void unit_animation::update_last_draw_time (  ) 

int unit_animation::get_begin_time (  )  const

int unit_animation::get_end_time (  )  const

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_.

int unit_animation::get_animation_time (  )  const [inline]

int unit_animation::get_animation_time_potential (  )  const [inline]

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

void unit_animation::pause_animation (  ) 

void unit_animation::restart_animation (  ) 

int unit_animation::get_current_frame_begin_time (  )  const [inline]

void unit_animation::redraw ( const frame_parameters value  ) 

Definition at line 734 of file unit_animation.cpp.

References sub_anims_.

Referenced by unit::redraw_unit().

void unit_animation::invalidate ( const frame_parameters value  )  const

Definition at line 742 of file unit_animation.cpp.

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

Referenced by unit::overlaps().

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

Definition at line 64 of file unit_animation.hpp.

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

Referenced by unit::overlaps(), and unit::redraw_unit().

config unit_animation::prepare_animation ( const config cfg,
const std::string  animation_tag 
) [static, private]


Friends And Related Function Documentation

friend class unit [friend]

Definition at line 61 of file unit_animation.hpp.


Member Data Documentation

Definition at line 100 of file unit_animation.hpp.

Referenced by matches().

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

Definition at line 101 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 102 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 103 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 104 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 105 of file unit_animation.hpp.

Referenced by matches().

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

Definition at line 106 of file unit_animation.hpp.

Referenced by fill_initial_animations(), matches(), and unit_animation().

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

Definition at line 107 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

Definition at line 108 of file unit_animation.hpp.

Referenced by fill_initial_animations(), matches(), and unit_animation().

Definition at line 109 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

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

Definition at line 110 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().

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

Definition at line 111 of file unit_animation.hpp.

Referenced by matches(), and unit_animation().


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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs