mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 09:03:29 +00:00
Added constructor to initialize all members.
Initialized all members in the main class. Removed the C style struct typedef.
This commit is contained in:
parent
767a7dbe89
commit
879dd99349
@ -118,7 +118,13 @@ class unit_animation
|
||||
class unit_animator
|
||||
{
|
||||
public:
|
||||
unit_animator():start_time_(INT_MIN){};
|
||||
unit_animator() :
|
||||
animated_units_(),
|
||||
start_time_(INT_MIN)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void add_animation(unit* animated_unit,const std::string& event,
|
||||
const gamemap::location &src = gamemap::location::null_location,
|
||||
const int value=0,bool with_bars = false,bool cycles = false,
|
||||
@ -146,7 +152,19 @@ class unit_animator
|
||||
void wait_for_end() const;
|
||||
void wait_until( int animation_time) const;
|
||||
private:
|
||||
typedef struct {
|
||||
struct anim_elem {
|
||||
|
||||
anim_elem() :
|
||||
my_unit(0),
|
||||
animation(0),
|
||||
text(),
|
||||
text_color(0),
|
||||
src(),
|
||||
with_bars(false),
|
||||
cycles(false)
|
||||
{
|
||||
}
|
||||
|
||||
unit *my_unit;
|
||||
const unit_animation * animation;
|
||||
std::string text;
|
||||
@ -154,7 +172,8 @@ class unit_animator
|
||||
gamemap::location src;
|
||||
bool with_bars;
|
||||
bool cycles;
|
||||
} anim_elem;
|
||||
};
|
||||
|
||||
std::vector<anim_elem> animated_units_;
|
||||
int start_time_;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user