Simple C++ Game
Public Member Functions | Protected Member Functions | List of all members
EnemyAISystem Class Reference

A system that performs the AI for the enemy player. More...

#include <EnemyAISystem.hpp>

Inheritance diagram for EnemyAISystem:
Inheritance graph
[legend]
Collaboration diagram for EnemyAISystem:
Collaboration graph
[legend]

Public Member Functions

 EnemyAISystem (Entity &ball)
 Construct a new Enemy AI System object. More...
 
- Public Member Functions inherited from IteratingSystem
 IteratingSystem ()
 Construct a new IteratingSystem with the default EntitySystem constructor. More...
 
 IteratingSystem (const std::shared_ptr< EntityFamily > &family)
 Construct a new IteratingSystem with the EntityFamily EntitySystem constructor. More...
 
void update (const sf::Time deltaTime)
 Iterates through each element in the system to perform updates. More...
 
- Public Member Functions inherited from EntitySystem
 EntitySystem ()
 Construct a new default EntitySystem. More...
 
 EntitySystem (const std::shared_ptr< EntityFamily > &family)
 Construct a new EntitySystem that acts on a specified family. More...
 
virtual void engineEntityAdded (const std::shared_ptr< Entity > &entity)
 Performs any operations required after an entity has been added to an EntityEngine the system is a part of. More...
 

Protected Member Functions

void process (std::shared_ptr< Entity > &ai, const sf::Time deltaTime)
 Processes the enemy AI for a single paddle. More...
 
- Protected Member Functions inherited from EntitySystem
virtual std::map< int, std::shared_ptr< Entity > > getEntities () const
 Get the Entities in the system. More...
 

Detailed Description

A system that performs the AI for the enemy player.

Constructor & Destructor Documentation

◆ EnemyAISystem()

EnemyAISystem::EnemyAISystem ( Entity ball)

Construct a new Enemy AI System object.

Parameters
ballThe ball that the AI will track to try to bounce back as part of the game of Pong.

Member Function Documentation

◆ process()

void EnemyAISystem::process ( std::shared_ptr< Entity > &  ai,
const sf::Time  deltaTime 
)
protectedvirtual

Processes the enemy AI for a single paddle.

Parameters
aiThe AI that is being processed.
deltaTimeThe amount of time that has passed since the last time the AI was processed.

Implements IteratingSystem.


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