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

Represents a drone in a physical system. Drones move using euler integration based on a specified velocity and direction. More...

#include <Drone.h>

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

Public Member Functions

 Drone (const JsonObject &obj)
 Drones are created with a name. More...
 
 ~Drone ()
 Destructor.
 
void getNextDelivery ()
 Gets the next delivery in the scheduler.
 
bool getPickedUp ()
 Gets the pickedUp status of the Drone object.
 
PackagegetPackage ()
 Gets pointer to the Drone's package.
 
IStrategygetFinalStrategy ()
 Returns pointer to toFinalDestination.
 
void update (double dt)
 Updates the drone's position. More...
 
 Drone (const Drone &drone)=delete
 Removing the copy constructor operator so that drones cannot be copied.
 
Droneoperator= (const Drone &drone)=delete
 Removing the assignment operator so that drones cannot be copied.
 
virtual IStrategygetToPackageStrategy ()
 Getter method for toPackage.
 
virtual IStrategygetToFinalDestinationStrategy ()
 Getter method for toFinalDestination.
 
bool isAvailable ()
 Checks if drone is available for a delivery. More...
 
bool isPickedUp ()
 Checks if drone is currently picked up. More...
 
void setToPackage (IStrategy *s)
 Sets the Drone's toPackage strategy to a new one. More...
 
- Public Member Functions inherited from IEntity
 IEntity ()
 Constructor that assigns a unique ID to the entity.
 
 IEntity (const JsonObject &details)
 Constructor with JsonObject details to define the entity. More...
 
virtual ~IEntity ()
 Virtual destructor for IEntity.
 
virtual void linkModel (SimulationModel *model)
 Links this entity to a simulation model, giving it access to the model's public variables and functions. More...
 
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...
 
virtual SimulationModelgetModel () const
 
- Public Member Functions inherited from IPublisher
void addObserver (const IObserver *o)
 adds an observer to the simulation More...
 
void removeObserver (const IObserver *o)
 removes an observer in the simulation More...
 
void notifyObservers (const std::string &message) const
 notifies all observers with a specific message More...
 

Additional Inherited Members

- Protected Attributes inherited from IEntity
SimulationModelmodel = nullptr
 
int id = -1
 
JsonObject details
 
Vector3 position
 
Vector3 direction
 
std::string color
 
std::string name
 
double speed = 0
 

Detailed Description

Represents a drone in a physical system. Drones move using euler integration based on a specified velocity and direction.

Constructor & Destructor Documentation

◆ Drone()

Drone::Drone ( const JsonObject obj)

Drones are created with a name.

Parameters
objJSON object containing the drone's information

Member Function Documentation

◆ isAvailable()

bool Drone::isAvailable ( )

Checks if drone is available for a delivery.

Returns
true if drone is available, false otherwise

◆ isPickedUp()

bool Drone::isPickedUp ( )

Checks if drone is currently picked up.

Returns
true if drone is picked upp, false otherwise

◆ setToPackage()

void Drone::setToPackage ( IStrategy s)
inline

Sets the Drone's toPackage strategy to a new one.

Parameters
sNew strategy for drone to get to package

◆ update()

void Drone::update ( double  dt)
virtual

Updates the drone's position.

Parameters
dtDelta time

Implements IEntity.


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