CSCI 3081 - Drone Delivery System
Public Member Functions | List of all members
csci3081::Customer Class Reference

A representation of a Customer, inherited from EntityBase It stores the Customer's name, ID, version, position, direction, and dynamic mode. More...

#include <customer.h>

Inheritance diagram for csci3081::Customer:
Inheritance graph

Public Member Functions

 Customer (const picojson::object &val)
 
 Customer (Customer &customer)
 Copy Constructor. This creates a new instance of Customer that has the same content as the Customer argument. More...
 
int GetNumPackageTotal () const
 This return the number of packages the customer has in total.
 
int GetNumDeliverPackage () const
 This return the number of packages the customer has in total.
 
void AddPackage (int packageID)
 This adds a package ID into the customer's tracked packageID vector if the package has not already been added. This would help check package delivery for the customer. More...
 
bool PackageDeliver (int packageID)
 This returns TRUE if the package with the ID passed in has already been delivered; FALSE otherwise. More...
 
int GetNumUndeliverPackage () const
 This return the number of undelivered packages the customer has.
 
- Public Member Functions inherited from csci3081::EntityBase
const picojson::object & GetDetails ()
 
int GetId () const
 
const std::string & GetName ()
 
const std::vector< float > & GetPosition () const
 
const std::vector< float > & GetDirection () const
 
float GetRadius () const
 
int GetVersion () const
 
bool IsDynamic () const
 
float DistanceBetween (IEntity *another)
 
bool IsWithin (IEntity *another)
 
std::string GetType ()
 
- Public Member Functions inherited from entity_project::IEntity
virtual ~IEntity ()
 The destructor.
 

Additional Inherited Members

- Protected Attributes inherited from csci3081::EntityBase
std::string name
 
int ID
 
std::vector< float > position
 
std::vector< float > direction
 
bool dynamic
 
int version
 
float radius
 
std::string type
 
picojson::object details
 

Detailed Description

A representation of a Customer, inherited from EntityBase It stores the Customer's name, ID, version, position, direction, and dynamic mode.

Constructor & Destructor Documentation

◆ Customer() [1/2]

csci3081::Customer::Customer ( const picojson::object &  val)

Constructor param[in] val: the json object of the Customer

◆ Customer() [2/2]

csci3081::Customer::Customer ( Customer customer)

Copy Constructor. This creates a new instance of Customer that has the same content as the Customer argument.

Parameters
[in]customerCustomer instance that wants to be copied

Member Function Documentation

◆ AddPackage()

void csci3081::Customer::AddPackage ( int  packageID)

This adds a package ID into the customer's tracked packageID vector if the package has not already been added. This would help check package delivery for the customer.

Parameters
[in]packageIDthe int for the ID of the package

◆ PackageDeliver()

bool csci3081::Customer::PackageDeliver ( int  packageID)

This returns TRUE if the package with the ID passed in has already been delivered; FALSE otherwise.

Parameters
[in]packageIDthe int for the ID of the package

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