CSCI3081W Drone Delivery System
Package.h
1 #ifndef PACKAGE_H
2 #define PACKAGE_H
3 
4 #include <vector>
5 
6 #include "IEntity.h"
7 #include "math/vector3.h"
8 #include "util/json.h"
9 
10 class Robot;
11 
17 class Package : public IEntity {
18  public:
23  Package(const JsonObject& obj);
24 
29  virtual Vector3 getDestination() const;
30 
36  virtual std::string getStrategyName() const;
37 
43  virtual Robot* getOwner() const;
44 
50  virtual bool requiresDelivery() const;
51 
57  virtual void setStrategyName(std::string strategyName_);
58 
64  virtual void update(double dt);
65 
71  virtual void initDelivery(Robot* owner);
72 
76  virtual void handOff();
77 
78  protected:
79  bool requiresDelivery_ = true;
80  Vector3 destination;
81  std::string strategyName;
82  Robot* owner = nullptr;
83 };
84 
85 #endif // PACKAGE_H
Represents an entity in a physical system.
Definition: IEntity.h:22
Manages a picojson::object, works with JsonValue to provide implicit casting.
Represents a package in a physical system. Packages move using euler integration based on a specified...
Definition: Package.h:17
virtual Robot * getOwner() const
Returns the owner of the package.
virtual void handOff()
Gives the robot/owner this package.
virtual void initDelivery(Robot *owner)
Sets the attributes for delivery.
virtual bool requiresDelivery() const
Returns whether or not the package needs to be delivered.
Package(const JsonObject &obj)
Constructor.
virtual Vector3 getDestination() const
Gets the Package's destination.
virtual void update(double dt)
Updates the Package.
virtual void setStrategyName(std::string strategyName_)
Set the Strategy Name.
virtual std::string getStrategyName() const
Returns the name of the strategy for this package.
Represents a robot in a physical system.
Definition: Robot.h:19
a simple class used for vector math, most function are self explanatory
Definition: vector3.h:12