35 static void add_anims(std::vector<unit_animation>& animations,
const config& cfg);
39 int value2 = 0)
const;
46 void add_frame(
const std::chrono::milliseconds& duration,
const unit_frame& value,
bool force_change =
false)
64 auto time_to_tick(
const std::chrono::milliseconds& animation_time)
const
87 ,
const std::string& text =
""
88 ,
const color_t text_color = {0,0,0}
89 ,
const bool accelerate =
true);
101 std::string
debug()
const;
115 explicit unit_animation(
const std::chrono::milliseconds& start_time
117 ,
const std::string& event =
""
132 explicit particle(
const config& cfg,
const std::string& frame_string =
"frame");
138 void override(
const std::chrono::milliseconds& start_time
139 ,
const std::chrono::milliseconds& duration
141 ,
const std::string& highlight =
""
142 ,
const std::string& blend_ratio =
""
143 ,
color_t blend_color = {0,0,0}
144 ,
const std::string& offset =
""
145 ,
const std::string& layer =
""
146 ,
const std::string& modifiers =
"");
175 std::vector<strike_result::type>
hits_;
194 ,
bool with_bars =
false
195 ,
const std::string& text =
""
196 ,
const color_t text_color = {0,0,0});
199 ,
const std::string& event
202 ,
const int value = 0
203 ,
bool with_bars =
false
204 ,
const std::string& text =
""
205 ,
const color_t text_color = {0,0,0}
224 ,
const std::string& event
227 ,
const int value = 0
231 ,
int value2 = 0)
const;
234 ,
const std::string& event
237 ,
const int value = 0
238 ,
bool with_bars =
false
239 ,
const std::string& text =
""
240 ,
const color_t text_color = {0,0,0}
262 void wait_until(
const std::chrono::milliseconds& animation_time)
const;
276 std::chrono::milliseconds
start_time_ = std::chrono::milliseconds::min();
std::chrono::milliseconds get_animation_time_potential() const
std::chrono::milliseconds get_begin_time() const
std::chrono::milliseconds get_current_frame_begin_time() const
std::chrono::milliseconds get_animation_time() const
void set_max_animation_time(const std::chrono::milliseconds &time)
void add_frame(const std::chrono::milliseconds &duration, const T &value, bool force_change=false)
Adds a frame to an animation.
const T & get_last_frame() const
std::chrono::steady_clock::time_point time_to_tick(const std::chrono::milliseconds &animation_time) const
const unit_frame & get_current_frame() const
std::chrono::milliseconds get_current_frame_time() const
A config object defines a single node in a WML file, with access to child nodes.
Easily build frame parameters with the serialized constructors.
Keep most parameters in a separate class to simplify the handling of the large number of parameters b...
frame_parameters parameters(const std::chrono::milliseconds ¤t_time) const
Getters for the different parameters.
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_parsed_parameters parameters_
std::chrono::milliseconds last_frame_begin_time_
bool need_minimal_update() const
particle(const std::chrono::milliseconds &start_time=std::chrono::milliseconds{0}, const frame_builder &builder=frame_builder())
frame_parameters parameters(const frame_parameters &default_val) const
void redraw(const frame_parameters &value, const map_location &src, const map_location &dst, halo::manager &halo_man)
auto get_animation_time_potential() const
bool invalidate(frame_parameters &value)
auto time_to_tick(const std::chrono::milliseconds &animation_time) const
std::vector< config > primary_attack_filter_
std::vector< map_location::direction > directions_
std::vector< int > value2_
bool need_minimal_update() const
bool animation_finished_potential() const
std::vector< config > secondary_unit_filter_
t_translation::ter_list terrain_types_
void add_frame(const std::chrono::milliseconds &duration, const unit_frame &value, bool force_change=false)
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)
frame_parameters get_current_params(const frame_parameters &default_val=frame_parameters()) const
std::chrono::milliseconds get_begin_time() const
std::vector< std::string > event_
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
std::vector< int > value_
std::string debug() const
void update_last_draw_time()
std::map< std::string, particle > sub_anims_
void update_parameters(const map_location &src, const map_location &dst)
std::chrono::milliseconds get_end_time() const
std::vector< std::string > get_flags() const
auto get_current_frame_begin_time() const
void redraw(frame_parameters &value, halo::manager &halo_man)
std::set< map_location > overlaped_hex_
const unit_frame & get_last_frame() const
auto get_animation_time() const
friend std::ostream & operator<<(std::ostream &outstream, const unit_animation &u_animation)
void set_max_animation_time(const std::chrono::milliseconds &time)
static void fill_initial_animations(std::vector< unit_animation > &animations, const config &cfg)
std::vector< config > secondary_attack_filter_
std::vector< config > unit_filter_
static void add_anims(std::vector< unit_animation > &animations, const config &cfg)
std::vector< strike_result::type > hits_
bool animation_finished() const
std::chrono::milliseconds get_animation_time_potential() const
std::chrono::milliseconds get_animation_time() const
std::chrono::milliseconds start_time_
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,...
std::vector< anim_elem > animated_units_
void wait_for_end() const
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 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})
std::chrono::milliseconds get_end_time() const
void wait_until(const std::chrono::milliseconds &animation_time) const
Describes a unit's animation sequence.
frame_parameters merge_parameters(const std::chrono::milliseconds ¤t_time, const frame_parameters &animation_val, const frame_parameters &engine_val=frame_parameters()) const
This function merges the value provided by:
This class represents a single unit of a specific type.
Definitions for the interface to Wesnoth Markup Language (WML).
Frame for unit's animation sequence.
std::shared_ptr< halo_record > handle
std::vector< terrain_code > ter_list
std::shared_ptr< const unit > unit_const_ptr
std::shared_ptr< const attack_type > const_attack_ptr
rect dst
Location on the final composed sheet.
rect src
Non-transparent portion of the surface to compose.
The basic class for representing 8-bit RGB or RGBA colour values.
All parameters from a frame at a given instant.
Encapsulates the map of the game.
static const map_location & null_location()
const unit_animation * animation