CSCI3081W Drone Delivery System
Drone.h
1 #ifndef DRONE_H_
2 #define DRONE_H_
3 
4 #include <vector>
5 
6 #include "IEntity.h"
7 #include "IStrategy.h"
8 #include "Package.h"
9 #include "PathStrategy.h"
10 #include "math/vector3.h"
11 
12 class Package;
13 
19 class Drone : public IEntity {
20  public:
25  Drone(const JsonObject& obj);
26 
30  ~Drone();
31 
36 
40  bool getPickedUp() { return pickedUp; }
41 
45  Package* getPackage() { return package; }
46 
50  IStrategy* getFinalStrategy() { return toFinalDestination; }
51 
56  void update(double dt);
57 
62  Drone(const Drone& drone) = delete;
63 
68  Drone& operator=(const Drone& drone) = delete;
69 
74 
79 
84  bool isAvailable();
85 
90  bool isPickedUp();
91 
96  void setToPackage(IStrategy* s) { toPackage = s; }
97 
98  private:
99  bool available = false;
100  bool pickedUp = false;
101  Package* package = nullptr;
102  IStrategy* toPackage = nullptr;
103  IStrategy* toFinalDestination = nullptr;
104  int portionNum = 1;
105 };
106 
107 #endif
Represents a drone in a physical system. Drones move using euler integration based on a specified vel...
Definition: Drone.h:19
bool isPickedUp()
Checks if drone is currently picked up.
Drone & operator=(const Drone &drone)=delete
Removing the assignment operator so that drones cannot be copied.
void setToPackage(IStrategy *s)
Sets the Drone's toPackage strategy to a new one.
Definition: Drone.h:96
Package * getPackage()
Gets pointer to the Drone's package.
Definition: Drone.h:45
void getNextDelivery()
Gets the next delivery in the scheduler.
~Drone()
Destructor.
virtual IStrategy * getToFinalDestinationStrategy()
Getter method for toFinalDestination.
IStrategy * getFinalStrategy()
Returns pointer to toFinalDestination.
Definition: Drone.h:50
void update(double dt)
Updates the drone's position.
virtual IStrategy * getToPackageStrategy()
Getter method for toPackage.
bool getPickedUp()
Gets the pickedUp status of the Drone object.
Definition: Drone.h:40
Drone(const JsonObject &obj)
Drones are created with a name.
bool isAvailable()
Checks if drone is available for a delivery.
Drone(const Drone &drone)=delete
Removing the copy constructor operator so that drones cannot be copied.
Represents an entity in a physical system.
Definition: IEntity.h:22
Strategy interface.
Definition: IStrategy.h:11
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