#pragma once #ifndef _SHAPE_H_ #define _SHAPE_H_ #include class Shape { /*Position for all shapes*/ struct Position { float shapeTop; float shapeBottom; float shapeLeft; float shapeRight; }; public: Shape(void); Shape(const float x, const float y, const float width, const float height); virtual ~Shape(void); float getTop() const { return position.shapeTop; }; float getBottom() const { return position.shapeBottom; }; float getLeft() const { return position.shapeLeft; }; float getRight() const { return position.shapeRight; }; float getOriginPositionX() const { return (position.shapeLeft + position.shapeRight) / 2; } float getOriginPositionY() const { return (position.shapeBottom + position.shapeTop) / 2; } virtual bool isDetectCollision(const Shape &shape) const = 0; void moveShape(const float x, const float y); bool getIncreaseX() const { return xBounds; } void setIncreaseX(const bool increaseX) { xBounds = increaseX; } bool getIncreaseY() const { return yBounds; } void setIncreaseY(const bool increaseY) { yBounds = increaseY; } virtual std::ostream& result(std::ostream& output) const = 0; bool operator==(const Shape &square) const; bool operator!=(const Shape &square) const; protected: Position position; bool xBounds; bool yBounds; }; #endif