Building Game Engines
AIControllerComponent.hpp
Go to the documentation of this file.
1 #ifndef AI_CONTROLLER_HPP
2 #define AI_CONTROLLER_HPP
3 
4 #include "Component.hpp"
5 #include "TransformComponent.hpp"
6 
11  public:
16 
22  AIControllerComponent(TransformComponent* transform, int radius, int type);
23 
28 
32  virtual void Update();
33 
37  virtual void Render(SDL_Renderer* renderer);
38 
39  int GetType();
40 
41  std::pair<double, double> GetStartPosition();
42 
43  int GetRadius();
44 
45  private:
46  // Points to the transform of the game object this component is attached to
47  TransformComponent* transform;
48 
49  // Used to calculate the minX and maxX
50  int radius;
51 
52  // The minimum and maximum distance that this game object may travel
53  int minX, maxX;
54 
55  // The speed of this game object
56  int speed = 1;
57 
58  // Determines if this game object is moving left or right
59  bool movingRight;
60 
61  //The type of enemy
62  int type;
63 };
64 
65 #endif
std::pair< double, double > GetStartPosition()
Definition: AIControllerComponent.cpp:50
AIControllerComponent(TransformComponent *transform)
Definition: AIControllerComponent.cpp:3
virtual void Update()
Definition: AIControllerComponent.cpp:21
~AIControllerComponent()
Definition: AIControllerComponent.cpp:17
int GetRadius()
Definition: AIControllerComponent.cpp:56
int GetType()
Definition: AIControllerComponent.cpp:46
Definition: TransformComponent.hpp:9
Definition: AIControllerComponent.hpp:10
Definition: Component.hpp:10
virtual void Render(SDL_Renderer *renderer)
Definition: AIControllerComponent.cpp:44