Public Types | |
enum | cycle_state { UNSET , CYCLE , NO_CYCLE } |
Public Types inherited from animated< unit_frame > | |
typedef std::pair< std::chrono::milliseconds, unit_frame > | frame_description |
typedef std::vector< frame_description > | anim_description |
Public Member Functions | |
particle (const std::chrono::milliseconds &start_time=std::chrono::milliseconds{0}, const frame_builder &builder=frame_builder()) | |
particle (const config &cfg, const std::string &frame_string="frame") | |
virtual | ~particle () |
bool | need_update () const |
bool | need_minimal_update () const |
void | override (const std::chrono::milliseconds &start_time, const std::chrono::milliseconds &duration, const cycle_state cycles, const std::string &highlight="", const std::string &blend_ratio="", color_t blend_color={0, 0, 0}, const std::string &offset="", const std::string &layer="", const std::string &modifiers="") |
void | redraw (const frame_parameters &value, const map_location &src, const map_location &dst, halo::manager &halo_man) |
std::set< map_location > | get_overlaped_hex (const frame_parameters &value, const map_location &src, const map_location &dst) |
void | start_animation (const std::chrono::milliseconds &start_time) |
frame_parameters | parameters (const frame_parameters &default_val) const |
void | clear_halo () |
Public Member Functions inherited from animated< unit_frame > | |
animated (const std::chrono::milliseconds &start_time=std::chrono::milliseconds{0}) | |
animated (const anim_description &cfg, const std::chrono::milliseconds &start_time=std::chrono::milliseconds{0}, bool force_change=false) | |
virtual | ~animated ()=default |
void | add_frame (const std::chrono::milliseconds &duration, const unit_frame &value, bool force_change=false) |
Adds a frame to an animation. More... | |
bool | not_started () const |
void | start_animation (const std::chrono::milliseconds &start_time, bool cycles=false) |
Starts an animation cycle. More... | |
void | pause_animation () |
void | restart_animation () |
std::chrono::milliseconds | get_begin_time () const |
std::chrono::milliseconds | get_end_time () const |
void | set_begin_time (const std::chrono::milliseconds &new_begin_time) |
std::chrono::steady_clock::time_point | time_to_tick (const std::chrono::milliseconds &animation_time) const |
std::chrono::milliseconds | tick_to_time (const std::chrono::steady_clock::time_point &animation_tick) const |
void | update_last_draw_time (double acceleration=0) |
bool | need_update () const |
bool | cycles () const |
bool | animation_finished () const |
Returns true if the current animation was finished. More... | |
bool | animation_finished_potential () const |
std::chrono::milliseconds | get_animation_time () const |
std::chrono::milliseconds | get_animation_time_potential () const |
void | set_animation_time (const std::chrono::milliseconds &time) |
void | set_max_animation_time (const std::chrono::milliseconds &time) |
std::chrono::milliseconds | get_animation_duration () const |
const unit_frame & | get_current_frame () const |
std::chrono::milliseconds | get_current_frame_begin_time () const |
std::chrono::milliseconds | get_current_frame_end_time () const |
std::chrono::milliseconds | get_current_frame_duration () const |
std::chrono::milliseconds | get_current_frame_time () const |
const unit_frame & | get_first_frame () const |
const unit_frame & | get_frame (std::size_t n) const |
const unit_frame & | get_last_frame () const |
std::size_t | get_frames_count () const |
void | force_change () |
bool | does_not_change () const |
Public Attributes | |
bool | accelerate |
Private Attributes | |
frame_parsed_parameters | parameters_ |
halo::handle | halo_id_ |
std::chrono::milliseconds | last_frame_begin_time_ |
bool | cycles_ |
Additional Inherited Members | |
Static Public Attributes inherited from animated< unit_frame > | |
static const unit_frame | void_value_ |
Protected Member Functions inherited from animated< unit_frame > | |
void | remove_frames_until (const std::chrono::milliseconds &starting_time) |
void | set_end_time (const std::chrono::milliseconds &ending_time) |
Protected Attributes inherited from animated< unit_frame > | |
std::chrono::milliseconds | starting_frame_time_ |
Definition at line 121 of file animation.hpp.
Enumerator | |
---|---|
UNSET | |
CYCLE | |
NO_CYCLE |
Definition at line 137 of file animation.hpp.
|
inlineexplicit |
Definition at line 124 of file animation.hpp.
|
explicit |
Definition at line 927 of file animation.cpp.
References animated< unit_frame >::add_frame(), config::child_range(), cycles_, frame_parsed_parameters::does_not_change(), unit_frame::does_not_change(), unit_frame::duration(), config::empty(), animated< unit_frame >::force_change(), animated< unit_frame >::get_animation_duration(), parameters_, and animated< unit_frame >::starting_frame_time_.
|
virtual |
Definition at line 1283 of file animation.cpp.
void unit_animation::particle::clear_halo | ( | ) |
Definition at line 1271 of file animation.cpp.
Referenced by unit_animation::clear_haloes().
std::set< map_location > unit_animation::particle::get_overlaped_hex | ( | const frame_parameters & | value, |
const map_location & | src, | ||
const map_location & | dst | ||
) |
Definition at line 1276 of file animation.cpp.
References dst, unit_animation::get_animation_time(), unit_animation::get_begin_time(), unit_frame::get_overlaped_hex(), and src.
Referenced by unit_animation::invalidate().
bool unit_animation::particle::need_minimal_update | ( | ) | const |
Definition at line 922 of file animation.cpp.
References unit_animation::get_current_frame_begin_time().
Referenced by unit_animation::need_minimal_update().
bool unit_animation::particle::need_update | ( | ) | const |
Definition at line 914 of file animation.cpp.
References unit_animation::need_update().
Referenced by unit_animation::need_update().
void unit_animation::particle::override | ( | const std::chrono::milliseconds & | start_time, |
const std::chrono::milliseconds & | duration, | ||
const cycle_state | cycles, | ||
const std::string & | highlight = "" , |
||
const std::string & | blend_ratio = "" , |
||
color_t | blend_color = {0,0,0} , |
||
const std::string & | offset = "" , |
||
const std::string & | layer = "" , |
||
const std::string & | modifiers = "" |
||
) |
Definition at line 888 of file animation.cpp.
References animated< unit_frame >::add_frame(), CYCLE, animated< unit_frame >::cycles(), cycles_, animated< unit_frame >::get_animation_duration(), animated< unit_frame >::get_last_frame(), NO_CYCLE, frame_parsed_parameters::override(), parameters_, animated< unit_frame >::set_begin_time(), and animated< unit_frame >::set_end_time().
|
inline |
Definition at line 150 of file animation.hpp.
References animated< unit_frame >::get_animation_time(), animated< unit_frame >::get_begin_time(), animated< unit_frame >::get_current_frame(), animated< unit_frame >::get_current_frame_time(), unit_frame::merge_parameters(), frame_parsed_parameters::parameters(), and parameters_.
Referenced by unit_animation::get_current_params().
void unit_animation::particle::redraw | ( | const frame_parameters & | value, |
const map_location & | src, | ||
const map_location & | dst, | ||
halo::manager & | halo_man | ||
) |
Definition at line 1247 of file animation.cpp.
References dst, unit_animation::get_animation_time(), unit_animation::get_begin_time(), unit_animation::get_current_frame_begin_time(), unit_frame::redraw(), and src.
Referenced by unit_animation::redraw().
void unit_animation::particle::start_animation | ( | const std::chrono::milliseconds & | start_time | ) |
Definition at line 1288 of file animation.cpp.
References unit_animation::get_begin_time(), and animated< T >::start_animation().
Referenced by unit_animation::start_animation().
bool unit_animation::particle::accelerate |
Definition at line 155 of file animation.hpp.
Referenced by unit_animation::start_animation(), and unit_animation::update_last_draw_time().
|
private |
Definition at line 162 of file animation.hpp.
Referenced by override(), and particle().
|
private |
Definition at line 160 of file animation.hpp.
|
private |
Definition at line 161 of file animation.hpp.
|
private |
Definition at line 159 of file animation.hpp.
Referenced by override(), parameters(), and particle().