Dragonfly 4.19
A text-based game engine
Public Member Functions | Private Attributes | List of all members
df::Precipitation Class Reference
Inheritance diagram for df::Precipitation:
Inheritance graph

Public Member Functions

 Precipitation (float size, Direction direction, unsigned char opacity, unsigned char r, unsigned char g, unsigned char b)
 
int eventHandler (const Event *p_e) override
 
void setTurbulence (bool new_turbulence=true)
 
- 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) override
 
virtual std::string serialize (std::string attr="") override
 
virtual int deserialize (std::string s) override
 
- 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 int setPosition (Vector new_position)
 
Vector getPosition () const
 
virtual int eventHandler (const Event *p_event)
 
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 new_position)
 
void doPathFollowing ()
 
int setVisible (bool new_visible=true)
 
bool isVisible () const
 
int setActive (bool new_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)
 
int setSprite (std::string sprite_label)
 
void setAnimation (Animation new_animation, bool set_box=true)
 
Animation getAnimation () const
 
virtual int draw ()
 
virtual std::string serialize (std::string attr="")
 
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 ()
 
std::string toString () const
 

Private Attributes

Direction m_direction
 
Vector m_velocity_init
 
bool m_turbulence
 

Additional Inherited Members

- Static Public Attributes inherited from df::Object
static int max_id
 

Constructor & Destructor Documentation

◆ Precipitation()

df::Precipitation::Precipitation ( float  size,
Direction  direction,
unsigned char  opacity,
unsigned char  r,
unsigned char  g,
unsigned char  b 
)

Constructor, specifing size, direction, opacity and rgb.

Member Function Documentation

◆ eventHandler()

int df::Precipitation::eventHandler ( const Event p_e)
overridevirtual

Handle step events.

Return 0 if ignored, else 1.

Reimplemented from df::Particle.

◆ setTurbulence()

void df::Precipitation::setTurbulence ( bool  new_turbulence = true)

Set turbulence of Precipitation.

Member Data Documentation

◆ m_direction

Direction df::Precipitation::m_direction
private

Direction precipitation travelling.

◆ m_turbulence

bool df::Precipitation::m_turbulence
private

True if turbulence.

◆ m_velocity_init

Vector df::Precipitation::m_velocity_init
private

Initial velocity.