#ifndef __CRASHING_OBJECT_H__ #define __CRASHING_OBJECT_H__ #include "draggableobject.h" extern const char* crashingObjectName; // This class is a crashable object. If two crashable objects // collide with each other, then display the bounding rectangle. class CrashingObject : public DraggableObject { public: // Initialize the pointer CrashingObject(); // Checks to see if the object is colliding with another. virtual bool update(World* world); // Modified version of DrawingObject::print, so that the box doesn't // get printed out. virtual void print(ostream& out) const; // Reads in a crashing object. Also calculates the bounding area of the // object. virtual void read(istream& in); ~CrashingObject(); protected: // Checks to see if the box is in the drawlist; if it is, then remove it. // returns true if successful. virtual bool removeBox(); // Checks to see if the box is in the drawlist; if it isn't, then create // a new rectangle, and add it to the drawlist. Returns true if successfully // added. virtual bool addBox(); private: DrawRectangle* box; }; #endif