#include <animation.hpp>
Classes | |
| class | particle |
Public Types | |
| enum | variation_type { MATCH_FAIL = -10 , DEFAULT_ANIM = -9 } |
Public Member Functions | |
| unit_animation ()=delete | |
| unit_animation (const config &cfg, const std::string &frame_string="") | |
| int | matches (const map_location &loc, const map_location &second_loc, const unit_const_ptr &my_unit, const std::string &event="", const int value=0, strike_result::type hit=strike_result::type::invalid, const const_attack_ptr &attack=nullptr, const const_attack_ptr &second_attack=nullptr, int value2=0) const |
| const unit_frame & | get_last_frame () const |
| void | add_frame (const std::chrono::milliseconds &duration, const unit_frame &value, bool force_change=false) |
| std::vector< std::string > | get_flags () const |
| bool | need_update () const |
| bool | need_minimal_update () const |
| bool | animation_finished () const |
| void | try_advance_to_current_frame () |
| std::chrono::milliseconds | get_begin_time () const |
| std::chrono::milliseconds | get_end_time () const |
| auto | get_elapsed_time () const |
| void | set_duration_limit (const std::chrono::milliseconds &time) |
| void | start_animation (const std::chrono::milliseconds &start_time, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const std::string &text="", const color_t text_color={0, 0, 0}, const bool accelerate=true) |
| void | update_parameters (const map_location &src, const map_location &dst) |
| void | pause_animation () |
| void | resume_animation () |
| auto | get_current_frame_begin_time () const |
| void | redraw (frame_parameters &value, halo::manager &halo_man) |
| void | clear_haloes () |
| bool | invalidate (frame_parameters &value) |
| std::string | debug () 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 | |
| frame_parameters | get_current_params (const frame_parameters &default_val=frame_parameters()) const |
Private Member Functions | |
| unit_animation (const std::chrono::milliseconds &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::ter_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< strike_result::type > | hits_ |
| std::vector< int > | value2_ |
| std::map< std::string, particle > | sub_anims_ |
| particle | unit_anim_ |
| map_location | src_ |
| map_location | dst_ |
| bool | invalidated_ |
| bool | play_offscreen_ |
| std::set< map_location > | overlaped_hex_ |
Friends | |
| class | unit |
| class | unit_drawer |
| std::ostream & | operator<< (std::ostream &outstream, const unit_animation &u_animation) |
Definition at line 26 of file animation.hpp.
| Enumerator | |
|---|---|
| MATCH_FAIL | |
| DEFAULT_ANIM | |
Definition at line 32 of file animation.hpp.
|
delete |
Referenced by fill_initial_animations().
|
explicit |
Definition at line 280 of file animation.cpp.
References config::all_children_view(), cfg, config::child_range(), d, directions_, event_, utils::views::filter, h, hits_, map_location::parse_direction(), play_offscreen_, primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, utils::split(), sub_anims_, unit_filter_, value2_, and value_.
|
explicitprivate |
Definition at line 255 of file animation.cpp.
References add_frame(), unit_frame::does_not_change(), and unit_frame::duration().
|
static |
Definition at line 644 of file animation.cpp.
References config::add_child(), config::add_child_at(), add_simple_anim(), cfg, config::child_range(), config::empty(), get_abs_frame_layer(), image::locator::get_filename(), get_heal_sound(), image::locator::get_modifications(), game_config::sounds::status::poisoned, prepare_animation(), utils::split(), unit_default, unit_missile_default, and unit_move_default.
Referenced by unit_animation_component::apply_new_animation_effect(), and fill_initial_animations().
|
inline |
Definition at line 46 of file animation.hpp.
References animated< T >::add_frame(), and unit_anim_.
Referenced by unit_animation().
| bool unit_animation::animation_finished | ( | ) | const |
Definition at line 1001 of file animation.cpp.
References animated< T >::animation_finished(), sub_anims_, and unit_anim_.
| void unit_animation::clear_haloes | ( | ) |
Definition at line 1108 of file animation.cpp.
References unit_animation::particle::clear_halo(), sub_anims_, and unit_anim_.
| std::string unit_animation::debug | ( | ) | const |
Definition at line 1161 of file animation.cpp.
|
static |
Definition at line 486 of file animation.cpp.
References add_anims(), frame_builder::blend(), cfg, utils::contains(), unit_animation::particle::CYCLE, DEFAULT_ANIM, frame_builder::duration(), get_abs_frame_layer(), get_heal_sound(), frame_builder::image(), unit_animation::particle::NO_CYCLE, config::optional_child(), game_config::sounds::status::poisoned, wfl::implementation::to_string(), unit_animation(), unit_move_default, and unit_animation::particle::UNSET.
Referenced by unit_type::animations().
| std::chrono::milliseconds unit_animation::get_begin_time | ( | ) | const |
Definition at line 1034 of file animation.cpp.
References animated< T >::get_begin_time(), sub_anims_, and unit_anim_.
Referenced by unit_animator::add_animation(), unit_animation::particle::get_overlaped_hex(), unit_animation::particle::redraw(), and unit_animation::particle::start_animation().
|
inline |
Definition at line 83 of file animation.hpp.
References animated< T >::get_current_frame_begin_time(), and unit_anim_.
Referenced by unit_animation::particle::need_minimal_update(), and unit_animation::particle::redraw().
|
inlineprotected |
Definition at line 98 of file animation.hpp.
References unit_animation::particle::parameters(), and unit_anim_.
|
inline |
Definition at line 63 of file animation.hpp.
References animated< T >::get_elapsed_time(), and unit_anim_.
Referenced by unit_animation::particle::get_overlaped_hex(), unit_animation::particle::redraw(), and unit_animator::wait_until().
| std::chrono::milliseconds unit_animation::get_end_time | ( | ) | const |
Definition at line 1024 of file animation.cpp.
References animated< T >::get_end_time(), sub_anims_, and unit_anim_.
|
inline |
Definition at line 51 of file animation.hpp.
References event_.
|
inline |
Definition at line 41 of file animation.hpp.
References animated< T >::get_last_frame(), and unit_anim_.
| bool unit_animation::invalidate | ( | frame_parameters & | value | ) |
Definition at line 1117 of file animation.cpp.
References dst_, unit_animation::particle::get_overlaped_hex(), 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_.
| int unit_animation::matches | ( | const map_location & | loc, |
| const map_location & | second_loc, | ||
| const unit_const_ptr & | my_unit, | ||
| const std::string & | event = "", |
||
| const int | value = 0, |
||
| strike_result::type | hit = strike_result::type::invalid, |
||
| const const_attack_ptr & | attack = nullptr, |
||
| const const_attack_ptr & | second_attack = nullptr, |
||
| int | value2 = 0 |
||
| ) | const |
Definition at line 379 of file animation.cpp.
References base_score_, c, utils::contains(), display::context(), randomness::rng::default_instance(), directions_, event_, f, utils::views::filter, unit_map::find(), frequency_, display::get_singleton(), gamemap_base::get_terrain(), hits_, loc, display_context::map(), MATCH_FAIL, primary_attack_filter_, secondary_attack_filter_, secondary_unit_filter_, t_translation::terrain_matches(), terrain_types_, unit_filter_, display_context::units(), value2_, and value_.
| bool unit_animation::need_minimal_update | ( | ) | const |
Definition at line 986 of file animation.cpp.
References unit_animation::particle::need_minimal_update(), play_offscreen_, sub_anims_, and unit_anim_.
Referenced by invalidate().
| bool unit_animation::need_update | ( | ) | const |
Definition at line 976 of file animation.cpp.
References unit_animation::particle::need_update(), sub_anims_, and unit_anim_.
Referenced by invalidate(), and unit_animation::particle::need_update().
| void unit_animation::pause_animation | ( | ) |
Definition at line 1076 of file animation.cpp.
References animated< T >::pause_animation(), sub_anims_, and unit_anim_.
| void unit_animation::redraw | ( | frame_parameters & | value, |
| halo::manager & | halo_man | ||
| ) |
Definition at line 1094 of file animation.cpp.
References dst_, invalidated_, overlaped_hex_, frame_parameters::primary_frame, unit_animation::particle::redraw(), src_, sub_anims_, and unit_anim_.
| void unit_animation::resume_animation | ( | ) |
Definition at line 1085 of file animation.cpp.
References animated< T >::resume_animation(), sub_anims_, and unit_anim_.
|
inline |
Definition at line 68 of file animation.hpp.
References animated< T >::set_duration_limit(), and unit_anim_.
| void unit_animation::start_animation | ( | const std::chrono::milliseconds & | start_time, |
| const map_location & | src = map_location::null_location(), |
||
| const map_location & | dst = map_location::null_location(), |
||
| const std::string & | text = "", |
||
| const color_t | text_color = {0,0,0}, |
||
| const bool | accelerate = true |
||
| ) |
Definition at line 1044 of file animation.cpp.
References animated< T >::add_frame(), dst, dst_, animated< T >::set_uses_acceleration(), src, src_, unit_animation::particle::start_animation(), sub_anims_, and unit_anim_.
| void unit_animation::try_advance_to_current_frame | ( | ) |
Definition at line 1012 of file animation.cpp.
References animated< T >::advance_to_current_frame(), unit_animation::particle::need_update(), sub_anims_, and unit_anim_.
| void unit_animation::update_parameters | ( | const map_location & | src, |
| const map_location & | dst | ||
| ) |
|
friend |
Definition at line 1168 of file animation.cpp.
|
friend |
Definition at line 93 of file animation.hpp.
|
friend |
Definition at line 94 of file animation.hpp.
|
private |
Definition at line 159 of file animation.hpp.
Referenced by matches().
|
private |
Definition at line 157 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 170 of file animation.hpp.
Referenced by invalidate(), redraw(), start_animation(), and update_parameters().
|
private |
Definition at line 160 of file animation.hpp.
Referenced by get_flags(), matches(), and unit_animation().
|
private |
Definition at line 158 of file animation.hpp.
Referenced by matches().
|
private |
Definition at line 164 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 172 of file animation.hpp.
Referenced by invalidate(), and redraw().
|
private |
Definition at line 174 of file animation.hpp.
Referenced by invalidate(), and redraw().
|
private |
Definition at line 173 of file animation.hpp.
Referenced by need_minimal_update(), and unit_animation().
|
private |
Definition at line 162 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 163 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 156 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 169 of file animation.hpp.
Referenced by invalidate(), redraw(), start_animation(), and update_parameters().
|
private |
Definition at line 166 of file animation.hpp.
Referenced by animation_finished(), clear_haloes(), get_begin_time(), get_end_time(), invalidate(), need_minimal_update(), need_update(), pause_animation(), redraw(), resume_animation(), start_animation(), try_advance_to_current_frame(), and unit_animation().
|
private |
Definition at line 154 of file animation.hpp.
Referenced by matches().
|
private |
Definition at line 167 of file animation.hpp.
Referenced by add_frame(), animation_finished(), clear_haloes(), get_begin_time(), get_current_frame_begin_time(), get_current_params(), get_elapsed_time(), get_end_time(), get_last_frame(), invalidate(), need_minimal_update(), need_update(), pause_animation(), redraw(), resume_animation(), set_duration_limit(), start_animation(), and try_advance_to_current_frame().
|
private |
Definition at line 155 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 165 of file animation.hpp.
Referenced by matches(), and unit_animation().
|
private |
Definition at line 161 of file animation.hpp.
Referenced by matches(), and unit_animation().