26 lines
No EOL
730 B
C++
26 lines
No EOL
730 B
C++
#ifndef MOVE_COMPONENT_H
|
|
#define MOVE_COMPONENT_H
|
|
|
|
#include <memory>
|
|
#include<math.h>
|
|
#include <SDL3/SDL_rect.h>
|
|
#include "../Actors/Actor.h"
|
|
#include "../DataStructures/NormalizedDirection.h"
|
|
|
|
class MoveComponent
|
|
{
|
|
public:
|
|
MoveComponent(std::weak_ptr<Actor> actor) : m_Actor(actor), m_Direction(NormalizedDirection()), m_Speed(50), m_ForcedDistance(0) {}; //TODO: speed
|
|
void Update(float deltaTime);
|
|
void SetDirection(const NormalizedDirection & direction);
|
|
void SetSpeed(float speed);
|
|
void SetForced(const NormalizedDirection & direction, float speed, float distance);
|
|
|
|
private:
|
|
std::weak_ptr<Actor> m_Actor;
|
|
NormalizedDirection m_Direction;
|
|
float m_Speed;
|
|
float m_ForcedDistance;
|
|
};
|
|
|
|
#endif |