|
Simple C++ Game
|
A Component for enemy AI paddles. More...
#include <EnemyAISystem.hpp>


Public Types | |
| enum class | AIState { Reacting , MovingDown , MovingUp , WaitingForPlayer } |
| An enumeration of the states of the enemy paddle AI. More... | |
Public Member Functions | |
| EnemyComponent () | |
| Construct a new Enemy Component object. More... | |
Public Member Functions inherited from Entity::Component | |
| Component (const std::string id) | |
| Construct a new Component object. More... | |
| virtual | ~Component () |
| This is only declared to make the class polymorphic so that dymaic_cast between Component types works. | |
| const std::string | getId () const |
| Get the ID of the component. This will return the same value for all instances of a class of Component. | |
Public Attributes | |
| sf::Time | reactionElapsedTime |
| The amount of time that the AI has spent waiting after the player took an action to respond. When this is greater than or equal to EnemyComponent::REACTION_TIME, the AI paddle can respond, simulating human reaction. | |
| AIState | aiState |
| The current state of the paddle's AI. | |
| float | predictedBallPosition |
| The current predicted impact position of the next ball that the paddle will try to intercept and bounce back. This, combined with EnemyComponent::predictionValid, form a pseudo-Optional<float>. | |
| bool | predictionValid |
| Whether or not the current prediction is a valid prediction that should be tracked to. This, combined with EnemyComponent::predictedBallPosition, form a pseudo-Optional<float>. | |
Static Public Attributes | |
| static const std::string | ENEMY_ID |
| The ID for EnemyCompnent. | |
| static const sf::Time | REACTION_TIME |
| The reaction time of an enemy AI after the player hits the ball. | |
| static const float | ENEMY_ERROR_SCALE |
A Component for enemy AI paddles.
The component marks an entity as an enemy AI paddle and stores related state, such as AI information.
|
strong |
An enumeration of the states of the enemy paddle AI.
| EnemyComponent::EnemyComponent | ( | ) |
Construct a new Enemy Component object.
The state information (e.g. AI) is unitialized and will need to be provided by the caller of the constructor.