Claypool

Courses

Publications

Students

Projects

Service

Downloads

Misc


Dragonfly: EventMouse.h Source File
Dragonfly 2.2
A text-based game engine

EventMouse.h

00001 ///
00002 /// A "mouse" event
00003 ///
00004 
00005 #ifndef __EVENT_MOUSE_H__
00006 #define __EVENT_MOUSE_H__
00007 
00008 #include "Event.h"
00009 
00010 #define MOUSE_EVENT "mouse"
00011 
00012 /// The set of mouse actions recognized by Dragonfly.
00013 enum MouseActionList {
00014   LEFT_BUTTON_CLICK,
00015   LEFT_BUTTON_DOUBLECLICK,
00016   RIGHT_BUTTON_CLICK,
00017   RIGHT_BUTTON_DOUBLECLICK,
00018   UNDEFINED
00019 };
00020 
00021 class EventMouse : public Event {
00022 
00023  protected:
00024   enum MouseActionList mouse_action; ///< Stores the mouse action.
00025   int mouse_x;                       ///< The mouse x coordinate.
00026   int mouse_y;                       ///< The mouse y coordinate.
00027 
00028  public:
00029   EventMouse();
00030 
00031   /// Load the mouse event's action.
00032   void setMouseAction(enum MouseActionList new_mouse_action);
00033 
00034   /// Get the mouse event's action.
00035   enum MouseActionList getMouseAction();
00036 
00037   /// Set the mouse event's x coordinate.
00038   void setMouseX(int new_x);
00039 
00040   /// Set the mouse event's y coordinate.
00041   void setMouseY(int new_y);
00042 
00043   /// Get the mouse event's x coordinate.
00044   int getMouseX();
00045 
00046   /// Get the mouse event's y coordinate.
00047   int getMouseY();
00048 };
00049 
00050 #endif // __EVENT_MOUSE_H__
 All Classes Functions Variables Friends