Building Game Engines
TransformComponent.hpp
Go to the documentation of this file.
1 #ifndef TRANSFORM_COMPONENT_HPP
2 #define TRANSFORM_COMPONENT_HPP
3 
4 #include "Component.hpp"
5 
9 class TransformComponent : public Component {
10  public:
22  virtual void Update();
26  virtual void Render(SDL_Renderer* renderer);
27 
28  // TODO: Not sure what this does
29  static const int hash = 10;
33  std::pair<double, double> GetPosition();
37  std::pair<double, double> GetVelocity();
41  std::pair<int, int> GetDimensions();
45  void SetPosition(double x, double y);
49  void SetVelocity(double x, double y);
53  void SetVelocityX(double x);
57  void SetVelocityY(double y);
61  void SetWidth(int w);
65  void SetHeight(int h);
66 
67  private:
71  double posx, posy;
75  double velx, vely;
79  int width, height;
80 };
81 
82 #endif
std::pair< double, double > GetVelocity()
Definition: TransformComponent.cpp:16
void SetVelocityY(double y)
Definition: TransformComponent.cpp:33
void SetVelocity(double x, double y)
Definition: TransformComponent.cpp:24
void SetHeight(int h)
Definition: TransformComponent.cpp:41
void SetPosition(double x, double y)
Definition: TransformComponent.cpp:20
void SetVelocityX(double x)
Definition: TransformComponent.cpp:29
void SetWidth(int w)
Definition: TransformComponent.cpp:37
Definition: TransformComponent.hpp:9
virtual void Render(SDL_Renderer *renderer)
Definition: TransformComponent.cpp:48
Definition: Component.hpp:10
virtual void Update()
Definition: TransformComponent.cpp:45
static const int hash
Definition: TransformComponent.hpp:29
~TransformComponent()
Definition: TransformComponent.cpp:11
std::pair< double, double > GetPosition()
Definition: TransformComponent.cpp:13
std::pair< int, int > GetDimensions()
Definition: TransformComponent.cpp:50
TransformComponent()
Definition: TransformComponent.cpp:3