#ifndef __DRAGGABLE_OBJECTS_H__ #define __DRAGGABLE_OBJECTS_H__ #include "object.h" #include "drawprimitives.h" #include "World.h" #include "boundedobject.h" // The DraggableObject is an interesting interactable object which // allows the user to click and drag the object around in the screen. // This class shows the amount of flexibility you have in writing // interesting behaviours into your objects. // extern const char* draggableObjectName; // The type identifier for a draggable object. class DraggableObject : public BoundedObject { public: DraggableObject(); virtual bool OnLButtonDown(World* world); virtual bool OnLButtonUp(World* world); virtual bool OnMouseMove(World* world); virtual bool update(World* world); virtual void print(ostream& out) const; virtual void read(istream& in); private: bool mouseDown; DrawPoint delta; }; #endif