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

Public Member Functions

 EventCollision ()
 
 EventCollision (Object *p_o1, Object *p_o2, Vector p)
 
void setObject1 (Object *p_new_o1)
 
ObjectgetObject1 () const
 
void setObject2 (Object *p_new_o2)
 
ObjectgetObject2 () const
 
void setPosition (Vector new_pos)
 
Vector getPosition () const
 
- Public Member Functions inherited from df::Event
 Event ()
 
virtual ~Event ()
 
void setType (std::string new_type)
 
std::string getType () const
 

Private Attributes

Vector m_pos
 
Objectm_p_obj1
 
Objectm_p_obj2
 

Constructor & Destructor Documentation

df::EventCollision::EventCollision ( )

Create collision event at (0,0) with o1 and o2 NULL.

df::EventCollision::EventCollision ( Object p_o1,
Object p_o2,
Vector  p 
)

Create collision event between o1 and o2 at position p.

Object o1 "caused" collision by moving into object o2.

Member Function Documentation

Object* df::EventCollision::getObject1 ( ) const

Return object that caused collision.

Object* df::EventCollision::getObject2 ( ) const

Return object that was collided with.

Vector df::EventCollision::getPosition ( ) const

Return position of collision.

void df::EventCollision::setObject1 ( Object p_new_o1)

Set object that caused collision.

void df::EventCollision::setObject2 ( Object p_new_o2)

Set object that was collided with.

void df::EventCollision::setPosition ( Vector  new_pos)

Set position of collision.

Member Data Documentation

Object* df::EventCollision::m_p_obj1
private

Object moving, causing collision.

Object* df::EventCollision::m_p_obj2
private

Object being collided with.

Vector df::EventCollision::m_pos
private

Where collision occurred.