The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
animated< T, T_void_value > Class Template Reference

#include <animated.hpp>

Classes

struct  frame
 

Public Types

typedef std::pair< int, T > frame_description
 
typedef std::vector
< frame_description
anim_description
 

Public Member Functions

 animated (int start_time=0)
 
virtual ~animated ()
 
 animated (const std::vector< frame_description > &cfg, int start_time=0, bool force_change=false)
 
void add_frame (int duration, const T &value, bool force_change=false)
 Adds a frame to an animation. More...
 
void start_animation (int start_time, bool cycles=false)
 Starts an animation cycle. More...
 
void pause_animation ()
 
void restart_animation ()
 
int get_begin_time () const
 
int get_end_time () const
 
void set_begin_time (int new_begin_time)
 
int time_to_tick (int animation_time) const
 
int tick_to_time (int 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
 
int get_animation_time () const
 
int get_animation_time_potential () const
 
void set_animation_time (int time)
 
void set_max_animation_time (int time)
 
int get_animation_duration () const
 
const T & get_current_frame () const
 
int get_current_frame_begin_time () const
 
int get_current_frame_end_time () const
 
int get_current_frame_duration () const
 
int get_current_frame_time () const
 
const T & get_first_frame () const
 
const T & get_frame (size_t n) const
 
const T & get_last_frame () const
 
size_t get_frames_count () const
 
void force_change ()
 
bool does_not_change () const
 

Static Public Attributes

static const T void_value_
 

Protected Member Functions

void remove_frames_until (int starting_time)
 
void set_end_time (int ending_time)
 

Protected Attributes

int starting_frame_time_
 

Private Attributes

bool does_not_change_
 
bool started_
 
bool force_next_update_
 
std::vector< frameframes_
 
int max_animation_time_
 
int start_tick_
 
bool cycles_
 
double acceleration_
 
int last_update_tick_
 
int current_frame_key_
 

Friends

class unit_animation
 

Detailed Description

template<typename T, typename T_void_value = void_value<T>>
class animated< T, T_void_value >

Definition at line 40 of file animated.hpp.

Member Typedef Documentation

template<typename T, typename T_void_value = void_value<T>>
typedef std::vector<frame_description> animated< T, T_void_value >::anim_description

Definition at line 47 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
typedef std::pair<int, T> animated< T, T_void_value >::frame_description

Definition at line 46 of file animated.hpp.

Constructor & Destructor Documentation

template<typename T, typename T_void_value = void_value<T>>
animated< T, T_void_value >::animated ( int  start_time = 0)
template<typename T, typename T_void_value = void_value<T>>
virtual animated< T, T_void_value >::~animated ( )
inlinevirtual

Definition at line 44 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
animated< T, T_void_value >::animated ( const std::vector< frame_description > &  cfg,
int  start_time = 0,
bool  force_change = false 
)

Member Function Documentation

template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::add_frame ( int  duration,
const T &  value,
bool  force_change = false 
)
template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::animation_finished ( ) const

Returns true if the current animation was finished.

Referenced by unit_animation::animation_finished(), and halo::halo_impl::effect::expired().

template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::animation_finished_potential ( ) const
template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::cycles ( ) const
inline

Definition at line 81 of file animated.hpp.

Referenced by halo::halo_impl::effect::expired().

template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::does_not_change ( ) const
inline

Definition at line 110 of file animated.hpp.

Referenced by halo::halo_impl::effect::does_change().

template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::force_change ( )
inline

Definition at line 105 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_animation_duration ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_animation_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_animation_time_potential ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_begin_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
const T& animated< T, T_void_value >::get_current_frame ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_current_frame_begin_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_current_frame_duration ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_current_frame_end_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_current_frame_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::get_end_time ( ) const
template<typename T, typename T_void_value = void_value<T>>
const T& animated< T, T_void_value >::get_first_frame ( ) const
template<typename T, typename T_void_value = void_value<T>>
const T& animated< T, T_void_value >::get_frame ( size_t  n) const
template<typename T, typename T_void_value = void_value<T>>
size_t animated< T, T_void_value >::get_frames_count ( ) const
template<typename T, typename T_void_value = void_value<T>>
const T& animated< T, T_void_value >::get_last_frame ( ) const
template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::need_update ( ) const
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::pause_animation ( )
inline

Definition at line 60 of file animated.hpp.

Referenced by unit_animation::pause_animation().

template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::remove_frames_until ( int  starting_time)
protected
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::restart_animation ( )
inline

Definition at line 65 of file animated.hpp.

Referenced by unit_animation::restart_animation().

template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::set_animation_time ( int  time)
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::set_begin_time ( int  new_begin_time)
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::set_end_time ( int  ending_time)
protected
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::set_max_animation_time ( int  time)
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::start_animation ( int  start_time,
bool  cycles = false 
)

Starts an animation cycle.

The first frame of the animation to start may be set to any value by using a start_time different to 0.

Referenced by halo::halo_impl::effect::effect(), display::init_flags_for_side_internal(), terrain_builder::load_images(), terrain_builder::rebuild_terrain(), and unit_animation::particle::start_animation().

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::tick_to_time ( int  animation_tick) const
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::time_to_tick ( int  animation_time) const
template<typename T, typename T_void_value = void_value<T>>
void animated< T, T_void_value >::update_last_draw_time ( double  acceleration = 0)

Friends And Related Function Documentation

template<typename T, typename T_void_value = void_value<T>>
friend class unit_animation
friend

Definition at line 118 of file animated.hpp.

Member Data Documentation

template<typename T, typename T_void_value = void_value<T>>
double animated< T, T_void_value >::acceleration_
private

Definition at line 158 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::current_frame_key_
private

Definition at line 160 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::cycles_
private

Definition at line 157 of file animated.hpp.

Referenced by animated< unit_frame >::cycles().

template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::does_not_change_
private
template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::force_next_update_
private

Definition at line 148 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
std::vector<frame> animated< T, T_void_value >::frames_
private

Definition at line 149 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::last_update_tick_
private

Definition at line 159 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::max_animation_time_
private

Definition at line 153 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::start_tick_
private

Definition at line 156 of file animated.hpp.

Referenced by animated< unit_frame >::restart_animation().

template<typename T, typename T_void_value = void_value<T>>
bool animated< T, T_void_value >::started_
private
template<typename T, typename T_void_value = void_value<T>>
int animated< T, T_void_value >::starting_frame_time_
protected

Definition at line 119 of file animated.hpp.

template<typename T, typename T_void_value = void_value<T>>
const T animated< T, T_void_value >::void_value_
static

Definition at line 115 of file animated.hpp.


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