#include <unit_animation.hpp>

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_frame & | get_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< config > | unit_filter_ |
| std::vector< config > | secondary_unit_filter_ |
| std::vector < map_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 > | value2_ |
| std::map< std::string, particule > | sub_anims_ |
| particule | unit_anim_ |
| map_location | src_ |
| map_location | dst_ |
| bool | invalidated_ |
| bool | play_offscreen_ |
| std::set< map_location > | overlaped_hex_ |
Friends | |
| class | unit |
Definition at line 26 of file unit_animation.hpp.
Definition at line 32 of file unit_animation.hpp.
Definition at line 31 of file unit_animation.hpp.
| 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] |
Definition at line 188 of file unit_animation.cpp.
References config::all_children_range(), config::child_range(), directions_, event_, HIT, hits_, config::any_child::key, KILL, MISS, map_location::parse_direction(), play_offscreen_, primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, utils::split(), sub_anims_, unit_filter_, value2_, and value_.

| 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().

| void unit_animation::add_anims | ( | std::vector< unit_animation > & | animations, | |
| const config & | cfg | |||
| ) | [static] |
Definition at line 504 of file unit_animation.cpp.
References config::add_child(), config::add_child_at(), add_simple_anim(), config::child_range(), display::LAYER_UNIT_DEFAULT, display::LAYER_UNIT_MISSILE_DEFAULT, display::LAYER_UNIT_MOVE_DEFAULT, animation_branch::merge(), prepare_animation(), display::rgb(), utils::split(), and unit_animation().
Referenced by unit::add_modification(), and fill_initial_animations().


| 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().


| const std::vector< std::string > & unit_animation::all_tag_names | ( | ) | [static] |
Definition at line 64 of file unit_animation.cpp.
Referenced by unit::unit().

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

| 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().


| 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().


| void unit_animation::fill_initial_animations | ( | std::vector< unit_animation > & | animations, | |
| const config & | cfg | |||
| ) | [static] |
Definition at line 360 of file unit_animation.cpp.
References add_anims(), DEFAULT_ANIM, gui2::event::find(), HIT, KILL, display::LAYER_UNIT_FIRST, display::LAYER_UNIT_MOVE_DEFAULT, unit_animation::particule::NO_CYCLE, display::rgb(), utils::split(), unit_animation(), and unit_animation::particule::UNSET.
Referenced by unit_type::animations().


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

| 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().


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

| 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().


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

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

| bool unit_animation::invalidate | ( | frame_parameters & | value | ) |
Definition at line 906 of file unit_animation.cpp.
References preferences::disp, dst_, unit_animation::particule::get_overlaped_hex(), game_display::get_singleton(), display::invalidate(), invalidated_, need_minimal_update(), need_update(), overlaped_hex_, frame_parameters::primary_frame, display::propagate_invalidation(), src_, sub_anims_, display::tile_nearly_on_screen(), and unit_anim_.
Referenced by unit::invalidate().


| 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 |
Definition at line 266 of file unit_animation.cpp.
References base_score_, unit_map::begin(), directions_, unit_map::end(), event_, unit::facing(), gui2::event::find(), frequency_, game_display::get_const_units(), 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_, t_translation::terrain_matches(), terrain_types_, unit_filter_, value2_, and value_.
Referenced by unit_animator::replace_anim_if_invalid().


| 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().


| 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().


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

| 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().


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

| 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().


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

| 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().


| void unit_animation::update_parameters | ( | const map_location & | src, | |
| const map_location & | dst | |||
| ) |
Definition at line 861 of file unit_animation.cpp.
friend class unit [friend] |
Definition at line 68 of file unit_animation.hpp.
int unit_animation::base_score_ [private] |
Definition at line 129 of file unit_animation.hpp.
Referenced by matches().
std::vector<map_location::DIRECTION> unit_animation::directions_ [private] |
Definition at line 127 of file unit_animation.hpp.
Referenced by matches(), and unit_animation().
map_location unit_animation::dst_ [private] |
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().
int unit_animation::frequency_ [private] |
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().
bool unit_animation::invalidated_ [private] |
Definition at line 142 of file unit_animation.hpp.
Referenced by invalidate(), and redraw().
std::set<map_location> unit_animation::overlaped_hex_ [private] |
Definition at line 144 of file unit_animation.hpp.
Referenced by invalidate(), and redraw().
bool unit_animation::play_offscreen_ [private] |
Definition at line 143 of file unit_animation.hpp.
Referenced by need_minimal_update(), and unit_animation().
std::vector<config> unit_animation::primary_attack_filter_ [private] |
Definition at line 132 of file unit_animation.hpp.
Referenced by matches(), and unit_animation().
std::vector<config> unit_animation::secondary_attack_filter_ [private] |
Definition at line 133 of file unit_animation.hpp.
Referenced by matches(), and unit_animation().
std::vector<config> unit_animation::secondary_unit_filter_ [private] |
Definition at line 126 of file unit_animation.hpp.
Referenced by matches(), and unit_animation().
map_location unit_animation::src_ [private] |
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 136 of file unit_animation.hpp.
Referenced by animation_finished(), animation_finished_potential(), clear_haloes(), get_begin_time(), get_end_time(), invalidate(), need_minimal_update(), need_update(), pause_animation(), redraw(), restart_animation(), start_animation(), unit_animation(), and update_last_draw_time().
Definition at line 124 of file unit_animation.hpp.
Referenced by matches().
particule unit_animation::unit_anim_ [private] |
Definition at line 137 of file unit_animation.hpp.
Referenced by add_frame(), animation_finished(), animation_finished_potential(), clear_haloes(), 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_minimal_update(), need_update(), pause_animation(), redraw(), restart_animation(), start_animation(), time_to_tick(), and update_last_draw_time().
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().
| Generated by doxygen 1.7.1 on Thu Feb 9 2012 01:08:14 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |