CSCI 3081 - Drone Delivery System
package.h
1 
7 #ifndef PACKAGE_H_
8 #define PACKAGE_H_
9 
10 /*******************************************************************************
11  * Includes
12  ******************************************************************************/
13 #include "entity_base.h"
14 #include <vector> // Used for vector like vector3D and vector2D
15 #include <string>
16 #include "customer.h"
17 #include "asubject.h"
18 
19 namespace csci3081 {
20 /*******************************************************************************
21  * Class Definitions
22  ******************************************************************************/
28  public:
34  Package(const picojson::object& detail);
35 
42  Package(Package& package);
43 
49  void SetOwner(Customer*);
50 
55  Customer* GetOwner();
56 
62  void SetPosition(std::vector<float> agr);
63 
69  void SetCarrier(IEntity*);
70 
76 
83  void SetDynamic(bool n);
84 
91  void Deliver();
92 
96  bool IsDelivered();
97 
104  void GetStatus();
105 
111  void Update(float dt);
112 
113  private:
114  Customer* owner;
115  IEntity* carrier;
116  bool delivered;
117 };
118 
119 }
120 
121 #endif /* PACKAGE_H_ */
Customer * GetOwner()
This returns a customer object of the package object if there is one, return NULL otherwise...
Definition: package.cc:65
A representation of a Customer, inherited from EntityBase It stores the Customer&#39;s name...
Definition: customer.h:25
void SetPosition(std::vector< float > agr)
This function uses to set the new position of the package. However, package only moves in simulation ...
Definition: package.cc:69
A representation of a Package, inherited from EntityBase It stores the Package&#39;s name, ID, version, position, direction, and dynamic mode.
Definition: package.h:27
bool IsDelivered()
This returns a TRUE if the package has been delivered, FALSE otherwise.
Definition: package.cc:44
void SetOwner(Customer *)
This links a customer object to the package object if the package has not already had a customer...
Definition: package.cc:39
Package(const picojson::object &detail)
Definition: package.cc:9
Definition: asubject.cc:3
void Update(float dt)
This is an inherited method from EntityBase to use for DeliverySimulation. This updates the position ...
Definition: package.cc:103
void Deliver()
This sets the deliverd attribute of the package to true, signaling that the package has already been ...
Definition: package.cc:48
IEntity * GetCarrier()
This returns the pointer that points to the carrier carrying the package if there is one; return NULL...
Definition: package.cc:80
void SetDynamic(bool n)
This changes the dynamic of the drone. Note that for the drone to move on the simulation, dynamic of the drone must be set to true.
Definition: package.cc:61
void SetCarrier(IEntity *)
This links a carrier Entity object (drone, truck, robot, etc) to the package object if the package ha...
Definition: package.cc:76
The base class for creating entities.
Definition: entity_base.h:27
void GetStatus()
Overwritten GetStatus from ASubject. This function creates the arguments required by Notify function ...
Definition: package.cc:84
A movable object in a scene. Entities have position, direction and size.
Definition: entity.h:15
This is the Abstract Subject class from which our subjects will inherit Implements the Observer/subje...
Definition: asubject.h:22