diff --git a/object.cpp b/object.cpp new file mode 100644 index 0000000..614a8ae --- /dev/null +++ b/object.cpp @@ -0,0 +1,9 @@ +#include "object.hpp" + +sf::Vector2f Object::getPosition() { + return position; +} + +int Object::getCharge() { + return charge; +} diff --git a/object.hpp b/object.hpp new file mode 100644 index 0000000..02f721d --- /dev/null +++ b/object.hpp @@ -0,0 +1,29 @@ +#ifndef PTF_OBJECT_HPP +#define PTF_OBJECT_HPP + +#include +#include + +class Object { +protected: + sf::Vector2f position; + int charge; + +public: + /** + * Dessine l'objet dans la fenêtre donnée + */ + virtual void draw(sf::RenderWindow& window) = 0; + + /** + * Récupère la position de l'objet + */ + sf::Vector2f getPosition(); + + /** + * Récupère la charge de l'objet + */ + int getCharge(); +}; + +#endif