CSCI 3081 - Drone Delivery System
charging_station.h
Go to the documentation of this file.
1 
5 #ifndef CHARGING_STATION_H
6 #define CHARGING_STATION_H
7 
8 /*******************************************************************************
9  * Includes
10  ******************************************************************************/
11 #include "entity_base.h"
12 #include <vector> // Used for vector like vector3D and vector2D
13 #include <string>
14 #include <recharge_drone.h>
15 #include <carrier.h>
16 #include <vector.h>
17 
18 namespace csci3081 {
19 /*******************************************************************************
20  * Class Definitions
21  ******************************************************************************/
27  public:
32  ChargingStation(const picojson::object& val);
33 
40  ChargingStation(ChargingStation& chargingStation);
41 
46  void AddDeadCarrier(Carrier* carrier);
47 
53  void PopDeadCarrier();
54 
61  bool HasDeadCarrier(Carrier* carrier);
62 
70  bool AddChargingDrone(RechargeDrone* chargingDrone);
71 
77  void RemoveChargingDrone(RechargeDrone* chargingDrone);
78 
86  void Update(float dt);
87 
88  private:
89  std::vector<RechargeDrone*> chargingDrones;
90  std::vector<Carrier*> deadCarriers;
91 };
92 
93 }
94 
95 #endif /* INC_CHARGING_STATION_H */
bool AddChargingDrone(RechargeDrone *chargingDrone)
This adds a unique charging drone to the charging station only if the distance between the two is clo...
Definition: charging_station.cc:48
A representation of a ChargingStation, inherited from EntityBase It stores the ChargingStation&#39;s name...
Definition: charging_station.h:26
void PopDeadCarrier()
This removes the first dead carrier from a deadCarriers vector. This is due to a recharging drone tha...
Definition: charging_station.cc:38
void Update(float dt)
This is an inherited method from EntityBase to use for DeliverySimulation. This updates the position ...
Definition: charging_station.cc:56
Definition: asubject.cc:3
ChargingStation(const picojson::object &val)
Definition: charging_station.cc:8
A representation of a drone It stores the drone&#39;s name, ID, version, position, direction, speed, and dynamic mode.
Definition: recharge_drone.h:38
bool HasDeadCarrier(Carrier *carrier)
This function checks if the charging station has already stored the dead carrier. ...
Definition: charging_station.cc:44
The base class for creating entities.
Definition: entity_base.h:27
A representation of a carrier An abstract base class for delivery transportation clases like Drone or...
Definition: carrier.h:31
void AddDeadCarrier(Carrier *carrier)
This adds a new dead carrier to a deadCarriers vector.
Definition: charging_station.cc:32
void RemoveChargingDrone(RechargeDrone *chargingDrone)
This removes a charging drone from the charging station. This is due to a charging drone leaving the ...