CSCI3081W Drone Delivery System
|
Decorator allowing for drones to make multiple deliveries, inherits from IObserver and DroneDecorator. More...
#include <MultiDeliveryDecorator.h>
Public Member Functions | |
MultiDeliveryDecorator (Drone *d) | |
Constructor. More... | |
~MultiDeliveryDecorator () | |
Destructor. | |
void | update (double dt) override |
Updates the child drone's position. More... | |
void | linkModel (SimulationModel *model) |
Links decorator to simulation and stores pointer. More... | |
void | pickupAdditional (Vector3 d) |
Pickups additional package if drone is in range. More... | |
void | storeAdditional () |
Stores additional packages to packages vector. | |
void | notify (const std::string &message) const |
Notifies observer with specific message. More... | |
Public Member Functions inherited from DroneDecorator | |
DroneDecorator (Drone *d) | |
Constructor for DroneDecorator, calls IEntityDecorator constructor. More... | |
virtual | ~DroneDecorator () |
Destructor. | |
virtual void | getNextDelivery () const |
Gets the next delivery in the scheduler. | |
virtual bool | getPickedUp () const |
Gets the pickedUp status of the Drone object. | |
virtual Package * | getPackage () const |
Gets pointer to the Drone's package. | |
virtual IStrategy * | getFinalStrategy () const |
Returns pointer to toFinalDestination. | |
virtual void | setToPackage (IStrategy *s) const |
Sets the Drone's toPackage strategy to a new one. More... | |
virtual SimulationModel * | getModel () const |
Get the Model object. More... | |
IStrategy * | getToFinalDestinationStrategy () |
Get the To Final Destination Strategy object. More... | |
IStrategy * | getToPackageStrategy () |
Get the To Package Strategy object. More... | |
Public Member Functions inherited from IEntityDecorator< Drone > | |
IEntityDecorator (T *e) | |
Constructor for IEntityDecorator. More... | |
virtual | ~IEntityDecorator () |
Destructor. | |
virtual int | getId () const |
Gets the ID of the entity. More... | |
virtual Vector3 | getPosition () const |
Gets the position of the entity. More... | |
virtual Vector3 | getDirection () const |
Gets the direction of the entity. More... | |
virtual const JsonObject & | getDetails () const |
Gets the details of the entity. More... | |
virtual std::string | getColor () const |
Gets the color of the entity. More... | |
virtual std::string | getName () const |
Gets the name of the entity. More... | |
virtual double | getSpeed () const |
Gets the speed of the entity. More... | |
virtual void | setPosition (Vector3 pos_) |
Sets the position of the entity. More... | |
virtual void | setDirection (Vector3 dir_) |
Set the direction of the entity. More... | |
virtual void | setColor (std::string col_) |
Sets the color of the entity. More... | |
virtual void | rotate (double angle) |
Rotate the entity around y axis. More... | |
Public Attributes | |
Vector3 | last = Vector3() |
bool | prompted = false |
Additional Inherited Members | |
Protected Attributes inherited from IEntityDecorator< Drone > | |
T * | sub |
Decorator allowing for drones to make multiple deliveries, inherits from IObserver and DroneDecorator.
MultiDeliveryDecorator::MultiDeliveryDecorator | ( | Drone * | d | ) |
Constructor.
Drone* | Drone to add functionality onto |
|
virtual |
Links decorator to simulation and stores pointer.
model | Simulation model |
Reimplemented from IEntityDecorator< Drone >.
|
virtual |
Notifies observer with specific message.
message | The specific message |
Implements IObserver.
void MultiDeliveryDecorator::pickupAdditional | ( | Vector3 | d | ) |
Pickups additional package if drone is in range.
d | Location of POI to make pickup at |
|
overridevirtual |