Dragonfly  4.3
A text-based game engine
Public Member Functions | Private Attributes | List of all members
df::Firework Class Reference
Inheritance diagram for df::Firework:
Inheritance graph
[legend]
Collaboration diagram for df::Firework:
Collaboration graph
[legend]

Public Member Functions

 Firework (float size, int age, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
 
int eventHandler (const Event *p_e)
 
- Public Member Functions inherited from df::Particle
 Particle (float size, int age, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
 
void setAge (int new_age)
 
int getAge () const
 
int eventHandler (const Event *p_e)
 
- Public Member Functions inherited from df::Object
 Object ()
 
virtual ~Object ()
 
void setId (int new_id)
 
int getId () const
 
void setType (std::string new_type)
 
std::string getType () const
 
virtual void setPosition (Vector new_position)
 
Vector getPosition () const
 
bool isSolid () const
 
int setSolidness (Solidness new_solid)
 
Solidness getSolidness () const
 
void setNoSoft (bool new_no_soft=true)
 
bool getNoSoft () const
 
void setAvoidCollisions (bool new_avoid_collisions=true)
 
bool getAvoidCollisions () const
 
int setAltitude (int new_altitude)
 
int getAltitude () const
 
void setSpeed (float speed)
 
float getSpeed () const
 
void setDirection (Vector new_direction)
 
Vector getDirection () const
 
void setVelocity (Vector velocity)
 
Vector getVelocity () const
 
void setAcceleration (Vector new_acceleration)
 
Vector getAcceleration () const
 
void accelerate ()
 
Vector predictPosition ()
 
void pathTo (Vector position)
 
void pathTo (Object *p_o_target)
 
void moveTo (Vector position)
 
void doPathFollowing ()
 
int setVisible (bool visible=true)
 
bool isVisible () const
 
int setActive (bool active=true)
 
bool isActive () const
 
void setBox (Box new_box)
 
Box getBox () const
 
int registerInterest (std::string event_type)
 
int unregisterInterest (std::string event_type)
 
virtual void draw ()
 
void setSpriteName (std::string new_name)
 
std::string getSpriteName () const
 
void setSprite (Sprite *p_new_sprite, bool set_box=true)
 
SpritegetSprite () const
 
void setCentered (bool centered=true)
 
bool isCentered () const
 
void setTransparency (char transparent=' ')
 
char getTransparency () const
 
void setSpriteIndex (int new_sprite_index)
 
int getSpriteIndex () const
 
void setSpriteSlowdown (int new_sprite_slowdown)
 
int getSpriteSlowdown () const
 
void setSpriteSlowdownCount (int new_sprite_slowdown_count)
 
int getSpriteSlowdownCount () const
 
virtual std::string serialize (bool all=false)
 
virtual int deserialize (std::string s)
 
virtual bool isModified (enum ObjectAttribute attribute) const
 
virtual bool isModified () const
 
void setShape (Shape new_shape)
 
Shape getShape () const
 
void setFollowPath (bool new_follow_path=true)
 
bool getFollowPath () const
 
void setPath (Path new_path)
 
Path getPath () const
 
PathFindgetPathFind ()
 

Private Attributes

unsigned char m_r
 
unsigned char m_g
 
unsigned char m_b
 
unsigned char m_initial_opacity
 
int m_initial_age
 
float m_initial_size
 

Constructor & Destructor Documentation

df::Firework::Firework ( float  size,
int  age,
unsigned char  opacity,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Constructor, specifing size, age, opacity and rgb.

Member Function Documentation

int df::Firework::eventHandler ( const Event p_e)
virtual

Handle step events.

Return 0 if ignored, else 1.

Reimplemented from df::Object.

Member Data Documentation

unsigned char df::Firework::m_b
private

RBG values for drawing.

int df::Firework::m_initial_age
private

Initial age when created.

unsigned char df::Firework::m_initial_opacity
private

Initial opacity when created.

float df::Firework::m_initial_size
private

Initial size when created.