x
class Package;
// Represents a drone in a physical system.
// Drones move using euler integration based on a specified
// velocity and direction.
/**
* @class Drone
* @brief Represents a drone in a physical system. Drones move using euler
* integration based on a specified velocity and direction.
*/
class Drone : public IEntity {
public:
/**
* @brief Drones are created with a name
* @param obj JSON object containing the drone's information
*/
Drone(const JsonObject& obj);
/**
* @brief Destructor
*/
~Drone();
/**
* @brief Gets the next delivery in the scheduler
*/
void getNextDelivery();
/**
* @brief Updates the drone's position
* @param dt Delta time
*/
void update(double dt);
/**
* @brief Removing the copy constructor operator
* so that drones cannot be copied.
*/
Drone(const Drone& drone) = delete;
/**
* @brief Removing the assignment operator
* so that drones cannot be copied.
*/
Drone& operator=(const Drone& drone) = delete;
/**
* @brief Getter method for toPackage
*/
IStrategy* getToPackageStrategy() {
return toPackage;
}
/**
* @brief Getter method for toFinalDestination
*/
IStrategy* getToFinalDestinationStrategy() {
return toFinalDestination;
}
bool hasToPackage() { return toPackage != nullptr; }
bool hasToFinalDestination() { return toFinalDestination != nullptr; }
protected:
bool available = false;
bool pickedUp = false;
Package* package = nullptr;
IStrategy* toPackage = nullptr;
IStrategy* toFinalDestination = nullptr;
};