11 #ifndef ENVIRONMENT_H_ 
   12 # define ENVIRONMENT_H_ 
   14 # include <SFML/Graphics.hpp> 
   16 # include "Graphics/i_object.h" 
   17 # include "Graphics/i_brain.h" 
   18 # include "Graphics/physics.h" 
   19 # include "GA/a_observable.h" 
   57     std::list<IObject *> 
const& 
getObjects(
void) 
const;
 
  112     void    Update(sf::Time elapsed);
 
  121     void    Run(std::list<GA::IDNA *>& brains);
 
  126     unsigned int            _num_epochs; 
 
  127     std::list<IObject *>        _env; 
 
  129     sf::Text                _best_fitness; 
 
  130     sf::Text                _avg_fitness; 
 
  133     static sf::RenderWindow     _window; 
 
  138     void    UpdateInfos(
void);
 
void setDisplay(bool display)
Set if the environment has to create a window. 
Definition: environment.cc:192
 
void Run(std::list< GA::IDNA * > &brains)
Run the simulation with the graphic environment. 
Definition: environment.cc:315
 
Define the abstract class that allow to be observable. 
Definition: a_observable.h:28
 
void setIsTournament(bool isTournament)
Set if the current environment is a tournament or not. 
Definition: environment.cc:187
 
Physics const & getPhysics(void) const 
Get the physics engine member. 
Definition: environment.cc:83
 
void Draw(void)
Draw all the objects on the window. 
Definition: environment.cc:247
 
Environment2D(void)
Constructor. 
Definition: environment.cc:34
 
void Update(sf::Time elapsed)
Update all the objects contains in the environment. 
Definition: environment.cc:232
 
Contains all the class that define the graphic environment. 
 
void LoadFromFile(const char *path)
Load the environment from the environment file given in parameters of LoveBrains. ...
Definition: environment.cc:145
 
~Environment2D(void)
Destructor. 
Definition: environment.cc:64
 
std::list< IObject * > const & getObjects(void) const 
Get all the objects of the environment. 
Definition: environment.cc:73
 
Define the physics engine used by the environment. 
Definition: physics.h:28
 
Definition: environment.h:31
 
sf::RenderWindow & getWindow(void)
Get the sf::RenderWindow member. 
Definition: environment.cc:93