CSCI3081W Drone Delivery System
PathStrategy.h
1 #ifndef PATH_STRATEGY_H_
2 #define PATH_STRATEGY_H_
3 
4 #include "IStrategy.h"
5 
11 class PathStrategy : public IStrategy {
12  protected:
13  std::vector<Vector3> path;
14  int index;
15 
16  public:
22  PathStrategy(std::vector<Vector3> path = {});
23 
30  virtual void move(IEntity* entity, double dt);
31 
38  virtual bool isCompleted();
39 
47  double currentPathDistance(Vector3 startPosition);
48 
49 
57  double totalPathDistance(Vector3 startPosition);
58 };
59 
60 #endif // PATH_STRATEGY_H_
Represents an entity in a physical system.
Definition: IEntity.h:22
Strategy interface.
Definition: IStrategy.h:11
this class inhertis from the IStrategy class and is represents a movement strategy where the entity s...
Definition: PathStrategy.h:11
double totalPathDistance(Vector3 startPosition)
Get the total distance of the entire path starting from startPosition and index 0.
virtual void move(IEntity *entity, double dt)
Move toward next position in the path.
PathStrategy(std::vector< Vector3 > path={})
Construct a new PathStrategy Strategy object.
double currentPathDistance(Vector3 startPosition)
Get the total distance of the entire path starting from startPosition and the current index.
virtual bool isCompleted()
Check if the trip is completed by seeing if index has reached the end of the path.
a simple class used for vector math, most function are self explanatory
Definition: vector3.h:12