LoveBrains  1.0.0
i_object.h
1 /*
2 ** a_object.h for LoveBrains in /home/robin_f/Programming/Git/CPP/LoveBrains
3 **
4 ** Made by Guillaume ROBIN
5 ** Login <robin_f@epitech.eu>
6 **
7 ** Started on Wed Jul 22 12:05:50 2015 Guillaume ROBIN
8 ** Last update Fri Aug 21 15:18:36 2015 Guillaume ROBIN
9 */
10 
11 #ifndef I_OBJECT_H_
12 # define I_OBJECT_H_
13 
14 # include <vector>
15 # include <string>
16 # include <SFML/Graphics.hpp>
17 
18 namespace Graphics
19 {
24  class IObject : public sf::Drawable
25  {
26  public:
30  virtual ~IObject(void) { }
31 
32  /*
33  ** Getters.
34  */
35 
41  virtual bool isDead(void) const = 0;
47  virtual bool hasBrain(void) const = 0;
52  virtual std::string getType(void) const = 0;
53 
54  /*
55  ** Setters.
56  */
57 
62  virtual void setPosition(sf::Vector2f const& position) = 0;
67  virtual void setIsDead(bool condition) = 0;
72  virtual void setElapsedTime(sf::Time& time) = 0;
73 
74  /*
75  ** Methods.
76  */
77 
83  virtual IObject *Clone(void) = 0;
87  virtual void Update(void) = 0;
88 
89  protected:
95  virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const = 0;
96  };
97 }
98 
99 #endif /* !A_OBJECT_H_ */
virtual void setPosition(sf::Vector2f const &position)=0
Set the current position of the object.
virtual void setElapsedTime(sf::Time &time)=0
Set the elapsed time between the previous and the current update.
virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const =0
Allow the object to be drawn on the window.
Define the interface of an object.
Definition: i_object.h:24
virtual std::string getType(void) const =0
Get the ky (type) of the object in the environment.
virtual IObject * Clone(void)=0
Clone the current object.
virtual ~IObject(void)
Destructor.
Definition: i_object.h:30
virtual void Update(void)=0
Update the object.
Contains all the class that define the graphic environment.
virtual bool isDead(void) const =0
Verify if the object is dead (not be able to draw).
virtual void setIsDead(bool condition)=0
Set the current state of the object.
virtual bool hasBrain(void) const =0
Verify if the object contains a neural network.