The Battle for Wesnoth  1.19.0-dev
Public Member Functions | Private Attributes | List of all members
unit_frame Class Reference

Describes a unit's animation sequence. More...

#include <frame.hpp>

Public Member Functions

 unit_frame (const frame_builder &builder=frame_builder())
 
void redraw (const int frame_time, bool on_start_time, bool in_scope_of_frame, const map_location &src, const map_location &dst, halo::handle &halo_id, halo::manager &halo_man, const frame_parameters &animation_val, const frame_parameters &engine_val) const
 
frame_parameters merge_parameters (int current_time, const frame_parameters &animation_val, const frame_parameters &engine_val=frame_parameters()) const
 This function merges the value provided by: More...
 
frame_parameters parameters (int current_time) const
 
frame_parameters end_parameters () const
 
int duration () const
 
bool does_not_change () const
 
bool need_update () const
 
std::vector< std::string > debug_strings () const
 
std::set< map_locationget_overlaped_hex (const int frame_time, const map_location &src, const map_location &dst, const frame_parameters &animation_val, const frame_parameters &engine_val) const
 

Private Attributes

frame_parsed_parameters builder_
 

Detailed Description

Describes a unit's animation sequence.

Definition at line 200 of file frame.hpp.

Constructor & Destructor Documentation

◆ unit_frame()

unit_frame::unit_frame ( const frame_builder builder = frame_builder())
inline

Definition at line 204 of file frame.hpp.

Member Function Documentation

◆ debug_strings()

std::vector<std::string> unit_frame::debug_strings ( ) const
inline

Definition at line 237 of file frame.hpp.

References builder_, and frame_parsed_parameters::debug_strings().

◆ does_not_change()

bool unit_frame::does_not_change ( ) const
inline

◆ duration()

int unit_frame::duration ( ) const
inline

◆ end_parameters()

frame_parameters unit_frame::end_parameters ( ) const
inline

Definition at line 217 of file frame.hpp.

References builder_, duration(), and frame_parsed_parameters::parameters().

◆ get_overlaped_hex()

std::set< map_location > unit_frame::get_overlaped_hex ( const int  frame_time,
const map_location src,
const map_location dst,
const frame_parameters animation_val,
const frame_parameters engine_val 
) const

◆ merge_parameters()

frame_parameters unit_frame::merge_parameters ( int  current_time,
const frame_parameters animation_val,
const frame_parameters engine_val = frame_parameters() 
) const

This function merges the value provided by:

  • the frame
  • the engine (poison, flying unit...)
  • the animation as a whole

There is no absolute rule for merging, so creativity is the rule. If a value is never provided by the engine, assert. This way if it becomes used, people will easily find the right place to look.

The engine provides a default image to use for the unit when none is available

The engine provides a default image to use for the unit when none is available

The engine provides a string for "petrified" and "team color" modifications. Note that image_mod is the complete modification and halo_mod is only the TC part.

The engine provides a y modification for terrain with height adjust and flying units

The engine provides a blend color for poisoned units

The engine provides a blend color for poisoned units

The engine provides a highlight ratio for selected units and visible "invisible" units

The engine provides a submerge for units in water

The engine provides a y modification for terrain with height adjust and flying units

The engine provides us with a default value to compare to. Update if different

Definition at line 901 of file frame.cpp.

References frame_parameters::auto_hflip, frame_parameters::auto_vflip, frame_parameters::blend_ratio, frame_parameters::blend_with, builder_, frame_parameters::directional_x, frame_parameters::directional_y, frame_parameters::drawing_layer, frame_parameters::duration, image::locator::get_filename(), frame_parameters::halo, frame_parameters::halo_mod, frame_parameters::halo_x, frame_parameters::halo_y, frame_parameters::highlight_ratio, frame_parameters::image, frame_parameters::image_diagonal, frame_parameters::image_mod, image::locator::is_void(), display::LAYER_UNIT_DEFAULT, display::LAYER_UNIT_FIRST, frame_parameters::offset, frame_parsed_parameters::parameters(), frame_parameters::primary_frame, frame_parameters::sound, frame_parameters::submerge, frame_parameters::text, frame_parameters::text_color, frame_parameters::x, and frame_parameters::y.

Referenced by get_overlaped_hex(), unit_animation::particle::parameters(), and redraw().

◆ need_update()

bool unit_frame::need_update ( ) const
inline

Definition at line 232 of file frame.hpp.

References builder_, and frame_parsed_parameters::need_update().

◆ parameters()

frame_parameters unit_frame::parameters ( int  current_time) const
inline

Definition at line 212 of file frame.hpp.

References builder_, and frame_parsed_parameters::parameters().

◆ redraw()

void unit_frame::redraw ( const int  frame_time,
bool  on_start_time,
bool  in_scope_of_frame,
const map_location src,
const map_location dst,
halo::handle halo_id,
halo::manager halo_man,
const frame_parameters animation_val,
const frame_parameters engine_val 
) const

Member Data Documentation

◆ builder_

frame_parsed_parameters unit_frame::builder_
private

The documentation for this class was generated from the following files: