CSCI3081W Drone Delivery System
MultiDeliveryDecorator.h
1 #ifndef MULTI_DELIVERY_DECORATOR_H_
2 #define MULTI_DELIVERY_DECORATOR_H_
3 
4 #include "BeelineStrategy.h"
5 #include "Drone.h"
6 #include "DroneDecorator.h"
7 #include "Package.h"
8 #include "PathStrategy.h"
9 #include "SimulationModel.h"
10 
16  public:
23 
28 
33  void update(double dt) override;
34 
39  void linkModel(SimulationModel* model);
40 
46 
51 
56  void notify(const std::string& message) const;
57 
58  // Position of the last POI visited by the drone
59  Vector3 last = Vector3();
60 
61  // Whether user has been prompted for a POI yet
62  bool prompted = false;
63 
64  private:
65  // Locations of all pois on map
66  std::vector<Vector3> pois;
67 
68  // All packages currently held by drone
69  std::vector<Package*> packages;
70 
71  SimulationModel* m = nullptr;
72  Package* extra_package = nullptr;
73 };
74 
75 #endif // MULTI_DELIVERY_DECORATOR_H_
Base class decorator for Drone that implements IEntityDecorator Drone template, delegates all work to...
Definition: DroneDecorator.h:13
Represents a drone in a physical system. Drones move using euler integration based on a specified vel...
Definition: Drone.h:19
Interface for Observer.
Definition: IObserver.h:10
Decorator allowing for drones to make multiple deliveries, inherits from IObserver and DroneDecorator...
Definition: MultiDeliveryDecorator.h:15
void storeAdditional()
Stores additional packages to packages vector.
~MultiDeliveryDecorator()
Destructor.
Definition: MultiDeliveryDecorator.h:27
void pickupAdditional(Vector3 d)
Pickups additional package if drone is in range.
void linkModel(SimulationModel *model)
Links decorator to simulation and stores pointer.
MultiDeliveryDecorator(Drone *d)
Constructor.
void update(double dt) override
Updates the child drone's position.
void notify(const std::string &message) const
Notifies observer with specific message.
Represents a package in a physical system. Packages move using euler integration based on a specified...
Definition: Package.h:17
Class SimulationModel handling the transit simulation. it can communicate with the controller.
Definition: SimulationModel.h:30
a simple class used for vector math, most function are self explanatory
Definition: vector3.h:12