delete map*
This commit is contained in:
parent
1515368711
commit
2423977721
@ -4,5 +4,26 @@
|
|||||||
|
|
||||||
void MovementComponent::Update(int delta_time)
|
void MovementComponent::Update(int delta_time)
|
||||||
{
|
{
|
||||||
|
if (path_index_ < paths_.size()) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool MovementComponent::GetMovePosition(int delta_time, Vector2D& out_pos)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MovementComponent::AddPathPoint(Vector2D& pos, float distance, float speed)
|
||||||
|
{
|
||||||
|
MovePathPoint& point = a8::FastAppend(paths_);
|
||||||
|
point.pos = pos;
|
||||||
|
point.distance = distance;
|
||||||
|
move_speed_ = speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MovementComponent::ClearPath()
|
||||||
|
{
|
||||||
|
move_speed_ = 0.0f;
|
||||||
|
path_index_ = 0;
|
||||||
|
paths_.clear();
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,24 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
struct MovePathPoint
|
||||||
|
{
|
||||||
|
Vector2D pos;
|
||||||
|
float distance = 0.0;
|
||||||
|
};
|
||||||
|
|
||||||
class Entity;
|
class Entity;
|
||||||
class MovementComponent
|
class MovementComponent
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Entity* owner = nullptr;
|
Entity* owner = nullptr;
|
||||||
int elapsed_time_ = 0;
|
|
||||||
|
|
||||||
virtual void Update(int delta_time);
|
virtual void Update(int delta_time);
|
||||||
|
bool GetMovePosition(int delta_time, Vector2D& out_pos);
|
||||||
|
void AddPathPoint(Vector2D& pos, float distance, float speed);
|
||||||
|
void ClearPath();
|
||||||
|
|
||||||
|
private:
|
||||||
|
float move_speed_ = 0.0f;
|
||||||
|
int path_index_ = 0;
|
||||||
|
std::vector<MovePathPoint> paths_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user