LoveBrains  1.0.0
Public Member Functions | List of all members
Graphics::Environment2D Class Reference
Inheritance diagram for Graphics::Environment2D:
GA::AObservable

Public Member Functions

 Environment2D (void)
 Constructor.
 
 Environment2D (unsigned int width, unsigned int height)
 Constructor. More...
 
 ~Environment2D (void)
 Destructor.
 
std::list< IObject * > const & getObjects (void) const
 Get all the objects of the environment. More...
 
std::list< IObject * > & getObjects (void)
 Get all the objects of the environment. More...
 
Physics const & getPhysics (void) const
 Get the physics engine member. More...
 
PhysicsgetPhysics (void)
 Get the physics engine member. More...
 
sf::RenderWindow & getWindow (void)
 Get the sf::RenderWindow member. More...
 
void LoadFromFile (const char *path)
 Load the environment from the environment file given in parameters of LoveBrains. More...
 
void setIsTournament (bool isTournament)
 Set if the current environment is a tournament or not. More...
 
void setDisplay (bool display)
 Set if the environment has to create a window. More...
 
Environment2Doperator= (Environment2D const &env)
 
void Update (sf::Time elapsed)
 Update all the objects contains in the environment. More...
 
void Draw (void)
 Draw all the objects on the window.
 
void Run (std::list< GA::IDNA * > &brains)
 Run the simulation with the graphic environment. More...
 
- Public Member Functions inherited from GA::AObservable
virtual ~AObservable (void)
 Destructor.
 
void addObserver (AObserver *obs)
 Add a new observer to the list. More...
 
void delObserver (AObserver *obs)
 Delete an observer. More...
 
void addObserver (AObserver *obs)
 
void delObserver (AObserver *obs)
 

Additional Inherited Members

- Protected Member Functions inherited from GA::AObservable
void Notify (AObserver::States state)
 Notify to the observers that something has changed. More...
 
void Notify (AObserver::States state)
 
- Protected Attributes inherited from GA::AObservable
std::list< AObserver * > _obs
 

Constructor & Destructor Documentation

Graphics::Environment2D::Environment2D ( unsigned int  width,
unsigned int  height 
)

Constructor.

Parameters
width: window's width
height: window's height.

Member Function Documentation

std::list< IObject * > const & Graphics::Environment2D::getObjects ( void  ) const

Get all the objects of the environment.

Returns
std::list<IObject *> const&
std::list< IObject * > & Graphics::Environment2D::getObjects ( void  )

Get all the objects of the environment.

Returns
std::list<IObject *> &
Physics const & Graphics::Environment2D::getPhysics ( void  ) const

Get the physics engine member.

Returns
Graphics::Physics const&
Physics & Graphics::Environment2D::getPhysics ( void  )

Get the physics engine member.

Returns
Graphics::Physics &
sf::RenderWindow & Graphics::Environment2D::getWindow ( void  )

Get the sf::RenderWindow member.

Returns
sf::RenderWindow &
void Graphics::Environment2D::LoadFromFile ( const char *  path)

Load the environment from the environment file given in parameters of LoveBrains.

Parameters
path: Contains the path of the environment file.
void Graphics::Environment2D::Run ( std::list< GA::IDNA * > &  brains)

Run the simulation with the graphic environment.

Parameters
brains: Contains all the neural networks used by the AI objects.
void Graphics::Environment2D::setDisplay ( bool  display)

Set if the environment has to create a window.

Parameters
display: (true) if the environment has to create a window.
void Graphics::Environment2D::setIsTournament ( bool  isTournament)

Set if the current environment is a tournament or not.

Parameters
isTournament: Contains the boolean that says if it's a tournament.
void Graphics::Environment2D::Update ( sf::Time  elapsed)

Update all the objects contains in the environment.

Parameters
elapsed: Contains the elapsed time between the current update and the previous update.

The documentation for this class was generated from the following files: