// // Created by trotfunky on 15/05/19. // #ifndef SNIPPETS_DRAWINGELEMENT_H #define SNIPPETS_DRAWINGELEMENT_H #include #include #include #include #include #include "xmlParser.h" namespace xmlParser { class DrawingElement { public: // TODO : S'arranger pour n'avoir que des constructeurs sensés : pas de constructeur vide/résultat non évident explicit DrawingElement(std::string label = "Test DrawingElement", float x = 0, float y = 1, const sf::Color& = sf::Color::Yellow); explicit DrawingElement(const pugi::xml_node&); virtual void draw(sf::RenderWindow&); void draw(sf::RenderWindow&, float referenceX, float referenceY); std::string label; virtual float getX() const; virtual void setX(float newX); virtual float getY() const; virtual void setY(float newY); const sf::Color& getColor() const; const std::string getStringColor() const; void setColor(const sf::Color& newColor); void setColor(const std::string& stringColor); virtual const std::string toString(int indent) const = 0; friend std::ostream& operator<<(std::ostream&,const DrawingElement&); protected: float x; float y; sf::Color color; std::unique_ptr shape; }; } #endif //SNIPPETS_DRAWINGELEMENT_H