CSCI3081W Drone Delivery System
Public Member Functions | Public Attributes | List of all members
MultiDeliveryDecorator Class Reference

Decorator allowing for drones to make multiple deliveries, inherits from IObserver and DroneDecorator. More...

#include <MultiDeliveryDecorator.h>

Inheritance diagram for MultiDeliveryDecorator:
Inheritance graph
[legend]
Collaboration diagram for MultiDeliveryDecorator:
Collaboration graph
[legend]

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 PackagegetPackage () const
 Gets pointer to the Drone's package.
 
virtual IStrategygetFinalStrategy () const
 Returns pointer to toFinalDestination.
 
virtual void setToPackage (IStrategy *s) const
 Sets the Drone's toPackage strategy to a new one. More...
 
virtual SimulationModelgetModel () const
 Get the Model object. More...
 
IStrategygetToFinalDestinationStrategy ()
 Get the To Final Destination Strategy object. More...
 
IStrategygetToPackageStrategy ()
 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 JsonObjectgetDetails () 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
 

Detailed Description

Decorator allowing for drones to make multiple deliveries, inherits from IObserver and DroneDecorator.

Constructor & Destructor Documentation

◆ MultiDeliveryDecorator()

MultiDeliveryDecorator::MultiDeliveryDecorator ( Drone d)

Constructor.

Parameters
Drone*Drone to add functionality onto

Member Function Documentation

◆ linkModel()

void MultiDeliveryDecorator::linkModel ( SimulationModel model)
virtual

Links decorator to simulation and stores pointer.

Parameters
modelSimulation model

Reimplemented from IEntityDecorator< Drone >.

◆ notify()

void MultiDeliveryDecorator::notify ( const std::string &  message) const
virtual

Notifies observer with specific message.

Parameters
messageThe specific message

Implements IObserver.

◆ pickupAdditional()

void MultiDeliveryDecorator::pickupAdditional ( Vector3  d)

Pickups additional package if drone is in range.

Parameters
dLocation of POI to make pickup at

◆ update()

void MultiDeliveryDecorator::update ( double  dt)
overridevirtual

Updates the child drone's position.

Parameters
dtDelta time

Reimplemented from DroneDecorator.


The documentation for this class was generated from the following file: