|
Building Game Engines
|
#include <AIControllerComponent.hpp>
Public Member Functions | |
| AIControllerComponent (TransformComponent *transform) | |
| AIControllerComponent (TransformComponent *transform, int radius, int type) | |
| ~AIControllerComponent () | |
| virtual void | Update () |
| virtual void | Render (SDL_Renderer *renderer) |
| int | GetType () |
| std::pair< double, double > | GetStartPosition () |
| int | GetRadius () |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=0 |
A component to give a game object artificial intelligence
| AIControllerComponent::AIControllerComponent | ( | TransformComponent * | transform | ) |
Default construcor. Transform is to keep track of position.
| AIControllerComponent::AIControllerComponent | ( | TransformComponent * | transform, |
| int | radius, | ||
| int | type | ||
| ) |
Constructor that takes in a transform and a radius. Radius is the distance enemies will walk from their current position. Type is what kind of enemy this component represents.
| AIControllerComponent::~AIControllerComponent | ( | ) |
Destructor.
| int AIControllerComponent::GetRadius | ( | ) |
| std::pair< double, double > AIControllerComponent::GetStartPosition | ( | ) |
| int AIControllerComponent::GetType | ( | ) |
|
virtual |
Empty method. This component does not need to be rendered.
Implements Component.
|
virtual |
Performs AI operations, like determining the direction the enemy should move,
Implements Component.
1.8.13