#include <animation.hpp>
Classes | |
| struct | anim_elem |
Public Member Functions | |
| void | add_animation (unit_const_ptr animated_unit, const unit_animation *animation, const map_location &src=map_location::null_location(), bool with_bars=false, const std::string &text="", const color_t text_color={0, 0, 0}) |
| void | add_animation (unit_const_ptr animated_unit, const std::string &event, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const int value=0, bool with_bars=false, const std::string &text="", const color_t text_color={0, 0, 0}, const strike_result::type hit_type=strike_result::type::invalid, const const_attack_ptr &attack=nullptr, const const_attack_ptr &second_attack=nullptr, int value2=0) |
| bool | has_animation (const unit_const_ptr &animated_unit, const std::string &event, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const int value=0, const strike_result::type hit_type=strike_result::type::invalid, const const_attack_ptr &attack=nullptr, const const_attack_ptr &second_attack=nullptr, int value2=0) const |
| has_animation : return an boolean value if animated unit present and have animation specified, used for verify prensence of [leading_anim] or [resistance_anim] for playability of [teaching_anim] More... | |
| void | replace_anim_if_invalid (const unit_const_ptr &animated_unit, const std::string &event, const map_location &src=map_location::null_location(), const map_location &dst=map_location::null_location(), const int value=0, bool with_bars=false, const std::string &text="", const color_t text_color={0, 0, 0}, const strike_result::type hit_type=strike_result::type::invalid, const const_attack_ptr &attack=nullptr, const const_attack_ptr &second_attack=nullptr, int value2=0) |
| void | start_animations () |
| void | pause_animation () |
| void | restart_animation () |
| void | clear () |
| void | set_all_standing () |
| bool | would_end () const |
| std::chrono::milliseconds | get_animation_time () const |
| std::chrono::milliseconds | get_animation_time_potential () const |
| std::chrono::milliseconds | get_end_time () const |
| void | wait_for_end () const |
| void | wait_until (const std::chrono::milliseconds &animation_time) const |
Private Attributes | |
| std::vector< anim_elem > | animated_units_ |
| std::chrono::milliseconds | start_time_ = std::chrono::milliseconds::min() |
Definition at line 188 of file animation.hpp.
| void unit_animator::add_animation | ( | unit_const_ptr | animated_unit, |
| const std::string & | event, | ||
| const map_location & | src = map_location::null_location(), |
||
| const map_location & | dst = map_location::null_location(), |
||
| const int | value = 0, |
||
| bool | with_bars = false, |
||
| const std::string & | text = "", |
||
| const color_t | text_color = {0,0,0}, |
||
| const strike_result::type | hit_type = strike_result::type::invalid, |
||
| const const_attack_ptr & | attack = nullptr, |
||
| const const_attack_ptr & | second_attack = nullptr, |
||
| int | value2 = 0 |
||
| ) |
Definition at line 1298 of file animation.cpp.
References dst, unit_animation::get_begin_time(), and src.
| void unit_animator::add_animation | ( | unit_const_ptr | animated_unit, |
| const unit_animation * | animation, | ||
| const map_location & | src = map_location::null_location(), |
||
| bool | with_bars = false, |
||
| const std::string & | text = "", |
||
| const color_t | text_color = {0,0,0} |
||
| ) |
Definition at line 1321 of file animation.cpp.
References unit_animation::get_begin_time(), and src.
Referenced by unit_display::unit_movement_animator::finish(), impl_add_animation(), unit_display::unit_movement_animator::start(), unit_display::unit_attack(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_healing(), unit_display::unit_recruited(), and unit_display::unit_sheath_weapon().
|
inline |
Definition at line 249 of file animation.hpp.
References animated_units_, and start_time_.
Referenced by unit_display::unit_movement_animator::finish(), impl_clear_animation(), game_lua_kernel::impl_run_animation(), unit_display::unit_movement_animator::start(), unit_display::unit_movement_animator::wait_for_anims(), and unit_display::unit_movement_animator::~unit_movement_animator().
| std::chrono::milliseconds unit_animator::get_animation_time | ( | ) | const |
Definition at line 1454 of file animation.cpp.
Referenced by unit_display::unit_attack().
| std::chrono::milliseconds unit_animator::get_animation_time_potential | ( | ) | const |
Definition at line 1462 of file animation.cpp.
Referenced by unit_display::unit_attack().
| std::chrono::milliseconds unit_animator::get_end_time | ( | ) | const |
Definition at line 1470 of file animation.cpp.
Referenced by unit_display::unit_attack().
| bool unit_animator::has_animation | ( | const unit_const_ptr & | animated_unit, |
| const std::string & | event, | ||
| const map_location & | src = map_location::null_location(), |
||
| const map_location & | dst = map_location::null_location(), |
||
| const int | value = 0, |
||
| const strike_result::type | hit_type = strike_result::type::invalid, |
||
| const const_attack_ptr & | attack = nullptr, |
||
| const const_attack_ptr & | second_attack = nullptr, |
||
| int | value2 = 0 |
||
| ) | const |
has_animation : return an boolean value if animated unit present and have animation specified, used for verify prensence of [leading_anim] or [resistance_anim] for playability of [teaching_anim]
| animated_unit | the unit who is checked. |
| event | the animation who is checked([leading_anim] or [resistance_anim]. |
| src | the location of animated_unit. |
| dst | location of unit student(attacker or defender). |
| value | value of damage. |
| hit_type | type of damage inflicted. |
| attack | weapon used by student. |
| second_attack | weapon used by opponent. |
| value2 | i don't understand myself.but this value is used in choose_animation. |
Definition at line 1334 of file animation.cpp.
Referenced by unit_display::unit_attack().
| void unit_animator::pause_animation | ( | ) |
Definition at line 1482 of file animation.cpp.
| void unit_animator::replace_anim_if_invalid | ( | const unit_const_ptr & | animated_unit, |
| const std::string & | event, | ||
| const map_location & | src = map_location::null_location(), |
||
| const map_location & | dst = map_location::null_location(), |
||
| const int | value = 0, |
||
| bool | with_bars = false, |
||
| const std::string & | text = "", |
||
| const color_t | text_color = {0,0,0}, |
||
| const strike_result::type | hit_type = strike_result::type::invalid, |
||
| const const_attack_ptr & | attack = nullptr, |
||
| const const_attack_ptr & | second_attack = nullptr, |
||
| int | value2 = 0 |
||
| ) |
Definition at line 1347 of file animation.cpp.
References dst, unit_animation::MATCH_FAIL, and src.
| void unit_animator::restart_animation | ( | ) |
Definition at line 1491 of file animation.cpp.
| void unit_animator::set_all_standing | ( | ) |
Definition at line 1500 of file animation.cpp.
Referenced by game_lua_kernel::impl_run_animation(), unit_display::unit_healing(), and unit_display::unit_recruited().
| void unit_animator::start_animations | ( | ) |
Definition at line 1373 of file animation.cpp.
Referenced by unit_display::unit_movement_animator::finish(), game_lua_kernel::impl_run_animation(), unit_display::unit_movement_animator::start(), unit_display::unit_attack(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_healing(), unit_display::unit_recruited(), and unit_display::unit_sheath_weapon().
| void unit_animator::wait_for_end | ( | ) | const |
Definition at line 1439 of file animation.cpp.
References resources::controller, and controller_base::play_slice().
Referenced by unit_display::unit_movement_animator::finish(), game_lua_kernel::impl_run_animation(), unit_display::unit_movement_animator::start(), unit_display::unit_attack(), unit_display::unit_die(), unit_display::unit_draw_weapon(), unit_display::unit_healing(), unit_display::unit_recruited(), unit_display::unit_sheath_weapon(), and unit_display::unit_movement_animator::wait_for_anims().
| void unit_animator::wait_until | ( | const std::chrono::milliseconds & | animation_time | ) | const |
Definition at line 1407 of file animation.cpp.
References resources::controller, unit_animation::get_animation_time(), display::get_singleton(), new_animation_frame(), controller_base::play_slice(), and display::turbo_speed().
Referenced by unit_display::unit_attack(), and unit_display::unit_movement_animator::wait_for_anims().
| bool unit_animator::would_end | ( | ) | const |
Definition at line 1397 of file animation.cpp.
Referenced by unit_display::unit_attack().
|
private |
Definition at line 275 of file animation.hpp.
Referenced by clear().
|
private |
Definition at line 276 of file animation.hpp.
Referenced by clear().