#include <unit_animation.hpp>
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_frame & | get_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< config > | unit_filter_ |
std::vector< config > | secondary_unit_filter_ |
std::vector < gamemap::location::DIRECTION > | directions_ |
int | frequency_ |
int | base_score_ |
std::vector< std::string > | event_ |
std::vector< int > | value_ |
std::vector< config > | primary_attack_filter_ |
std::vector< config > | secondary_attack_filter_ |
std::vector< hit_type > | hits_ |
std::vector< int > | swing_num_ |
std::map< std::string, particule > | sub_anims_ |
particule | unit_anim_ |
Friends | |
class | unit |
Classes | |
class | particule |
Definition at line 29 of file unit_animation.hpp.
unit_animation::unit_animation | ( | ) | [private] |
unit_animation::unit_animation | ( | const config & | cfg, | |
const std::string | frame_string = "" | |||
) | [explicit, private] |
Definition at line 119 of file unit_animation.cpp.
References config::all_children(), config::child_range(), directions_, event_, frequency_, HIT, hits_, KILL, MISS, gamemap::location::parse_direction(), primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, utils::split(), sub_anims_, swing_num_, unit_filter_, value, and value_.
unit_animation::unit_animation | ( | int | start_time, | |
const unit_frame & | frame, | |||
const std::string & | event = "" , |
|||
const int | variation = DEFAULT_ANIM | |||
) | [explicit, private] |
Definition at line 99 of file unit_animation.cpp.
References add_frame(), unit_frame::does_not_change(), and unit_frame::duration().
void unit_animation::fill_initial_animations | ( | std::vector< unit_animation > & | animations, | |
const config & | cfg | |||
) | [static] |
Definition at line 303 of file unit_animation.cpp.
References add_anims(), lg::config, DEFAULT_ANIM, event_, unit_animation::particule::override(), primary_attack_filter_, animated< T, T_void_value >::remove_frames_after(), display::rgb(), utils::split(), unit_anim_, and unit_animation().
Referenced by unit_type::animations(), and unit::read().
void unit_animation::add_anims | ( | std::vector< unit_animation > & | animations, | |
const config & | cfg | |||
) | [static] |
Definition at line 423 of file unit_animation.cpp.
References config::add_child(), config::add_child_at(), config::get_children(), prepare_animation(), display::rgb(), and unit_animation().
Referenced by unit::add_modification(), and fill_initial_animations().
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 |
Definition at line 208 of file unit_animation.cpp.
References base_score_, unit_map::begin(), directions_, unit_map::end(), event_, unit::facing(), frequency_, game_display::get_const_units(), gamemap::location::get_direction(), display::get_map(), gamemap::get_terrain(), hits_, MATCH_FAIL, attack_type::matches_filter(), unit::matches_filter(), primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, swing_num_, t_translation::terrain_matches(), terrain_types_, unit_filter_, and value_.
Referenced by unit_animator::replace_anim_if_invalid().
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 |
Definition at line 639 of file unit_animation.cpp.
References unit_animation::particule::need_update(), sub_anims_, and unit_anim_.
Referenced by game_display::invalidate_animations().
bool unit_animation::animation_finished | ( | ) | const |
Definition at line 649 of file unit_animation.cpp.
References animated< T, T_void_value >::animation_finished(), sub_anims_, and unit_anim_.
bool unit_animation::animation_finished_potential | ( | ) | const |
Definition at line 659 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().
void unit_animation::update_last_draw_time | ( | ) |
Definition at line 669 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().
int unit_animation::get_begin_time | ( | ) | const |
Definition at line 689 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().
int unit_animation::get_end_time | ( | ) | const |
Definition at line 679 of file unit_animation.cpp.
References animated< T, T_void_value >::get_end_time(), sub_anims_, and unit_anim_.
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] |
Definition at line 52 of file unit_animation.hpp.
References animated< T, T_void_value >::get_animation_time(), and unit_anim_.
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_.
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 | |||
) |
Definition at line 699 of file unit_animation.cpp.
References unit_animation::particule::accelerate, animated< T, T_void_value >::add_frame(), new_animation_frame(), unit_animation::particule::start_animation(), sub_anims_, text, and unit_anim_.
Referenced by unit::start_animation().
void unit_animation::pause_animation | ( | ) |
Definition at line 716 of file unit_animation.cpp.
References animated< T, T_void_value >::pause_animation(), sub_anims_, and unit_anim_.
void unit_animation::restart_animation | ( | ) |
Definition at line 725 of file unit_animation.cpp.
References animated< T, T_void_value >::restart_animation(), sub_anims_, and unit_anim_.
int unit_animation::get_current_frame_begin_time | ( | ) | const [inline] |
Definition at line 57 of file unit_animation.hpp.
References animated< T, T_void_value >::get_current_frame_begin_time(), and unit_anim_.
Referenced by unit::redraw_unit().
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] |
Definition at line 37 of file unit_animation.cpp.
References config::add_child(), config::append(), config::child_range(), config::ordered_begin(), config::ordered_end(), and config::values.
Referenced by add_anims().
friend class unit [friend] |
Definition at line 61 of file unit_animation.hpp.
std::vector<config> unit_animation::unit_filter_ [private] |
std::vector<config> unit_animation::secondary_unit_filter_ [private] |
std::vector<gamemap::location::DIRECTION> unit_animation::directions_ [private] |
int unit_animation::frequency_ [private] |
int unit_animation::base_score_ [private] |
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] |
std::vector<config> unit_animation::primary_attack_filter_ [private] |
Definition at line 108 of file unit_animation.hpp.
Referenced by fill_initial_animations(), matches(), and unit_animation().
std::vector<config> unit_animation::secondary_attack_filter_ [private] |
std::vector<hit_type> unit_animation::hits_ [private] |
std::vector<int> unit_animation::swing_num_ [private] |
std::map<std::string,particule> unit_animation::sub_anims_ [private] |
Definition at line 112 of file unit_animation.hpp.
Referenced by animation_finished(), animation_finished_potential(), get_begin_time(), get_end_time(), invalidate(), need_update(), pause_animation(), redraw(), restart_animation(), start_animation(), unit_animation(), and update_last_draw_time().
particule unit_animation::unit_anim_ [private] |
Definition at line 113 of file unit_animation.hpp.
Referenced by add_frame(), animation_finished(), animation_finished_potential(), fill_initial_animations(), get_animation_time(), get_animation_time_potential(), get_begin_time(), get_current_frame_begin_time(), get_current_params(), get_end_time(), get_last_frame(), invalidate(), need_update(), pause_animation(), restart_animation(), start_animation(), time_to_tick(), and update_last_draw_time().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |