Dragonfly 4.20
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

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

◆ EventCollision() [1/2]

df::EventCollision::EventCollision ( )

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

◆ EventCollision() [2/2]

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

◆ getObject1()

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

Return object that caused collision.

◆ getObject2()

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

Return object that was collided with.

◆ getPosition()

Vector df::EventCollision::getPosition ( ) const

Return position of collision.

◆ setObject1()

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

Set object that caused collision.

◆ setObject2()

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

Set object that was collided with.

◆ setPosition()

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

Set position of collision.

Member Data Documentation

◆ m_p_obj1

Object* df::EventCollision::m_p_obj1
private

Object moving, causing collision.

◆ m_p_obj2

Object* df::EventCollision::m_p_obj2
private

Object being collided with.

◆ m_pos

Vector df::EventCollision::m_pos
private

Where collision occurred.