SDL2lazy
Public Member Functions | Public Attributes | Private Attributes | List of all members
SlEventObject Class Reference

#include <SlEventHandler.h>

Public Member Functions

 SlEventObject ()
 
 ~SlEventObject ()
 
 SlEventObject (const SlEventObject &)=delete
 
SlEventObject & operator= (const SlEventObject &)=delete
 
void addAction (std::string name, int destination, SlManipulation *manip, std::vector< std::string > params)
 
void trigger (int mouse_x=-1, int mouse_y=-1)
 

Public Attributes

bool need_mouse_coordinates = false
 

Private Attributes

std::vector< SlEventAction > actions_
 
int last_mouse_ [2] = {-1,-1}
 

Detailed Description

Object associated with a specific user input. This object's SlEventActions will be performed when the corresponding input event is received.

Constructor & Destructor Documentation

SlEventObject::SlEventObject ( )

Default constructor

SlEventObject::~SlEventObject ( )

Default destructor

SlEventObject::SlEventObject ( const SlEventObject &  )
delete

Delete copy constructor. Each EventObject is associated with a specific input.

Member Function Documentation

void SlEventObject::addAction ( std::string  name,
int  destination,
SlManipulation *  manip,
std::vector< std::string >  params 
)

Adds a new SlEventAction to actions_.

SlEventObject& SlEventObject::operator= ( const SlEventObject &  )
delete

Deleted, same reason as copy constructor.

void SlEventObject::trigger ( int  mouse_x = -1,
int  mouse_y = -1 
)

Triggers the SlEventAction::act() for all objects in actions_.

Member Data Documentation

std::vector<SlEventAction> SlEventObject::actions_
private

The SlEventActions that will be performed when this object is triggered.

int SlEventObject::last_mouse_[2] = {-1,-1}
private

Store previous mouse coordinates for relative movement.

bool SlEventObject::need_mouse_coordinates = false

Determines if this object required mouse coordinates. If true, coordinates and delta-coordinates will be added to parameters.


The documentation for this class was generated from the following files: