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

Public Member Functions

 Battery ()
 Default Constructor. This sets up an instance of Battery with empty remaining life.
 
 Battery (float remainingLifeinSec_, std::string batteryType="carrier")
 Constructor to set up an instance of Battery with passing remaining life. More...
 
float GetRemainingLife ()
 
float GetMaxCharge ()
 
int GetDisplayBar ()
 
int GetId ()
 
void Depleting (float sec)
 Depleting The Battery. Should be used everytime the object using battery is in action. More...
 
bool Charging (float sec)
 Charging The Battery. More...
 
float TimeToFull ()
 This function returns the time battery needed charged to be full.
 
bool IsDead ()
 This returns a boolean value for the battery's life False if battery is dead (below 20%) True otherwise.
 
bool IsFull ()
 This returns a boolean value if the battery is full. True if the battery is full. False otherwise.
 

Constructor & Destructor Documentation

◆ Battery()

csci3081::Battery::Battery ( float  remainingLifeinSec_,
std::string  batteryType = "carrier" 
)

Constructor to set up an instance of Battery with passing remaining life.

Parameters
[in]remainingLifeinSec_current remaining life in the battery
[in]batteryTypeoptional; there are 2 types of batteries: carrier and recharging_drone. Recharging drone has higher maxCharge than carrier. Default of batterType is carrier.

Member Function Documentation

◆ Charging()

bool csci3081::Battery::Charging ( float  sec)

Charging The Battery.

Parameters
[in]secseconds battery is charged
[out]Trueif the battery is charged, False otherwise

◆ Depleting()

void csci3081::Battery::Depleting ( float  sec)

Depleting The Battery. Should be used everytime the object using battery is in action.

Parameters
[in]secseconds battery is used

◆ GetDisplayBar()

int csci3081::Battery::GetDisplayBar ( )

This functions return the current displayBar of the Battery

◆ GetId()

int csci3081::Battery::GetId ( )

This functions return the ID of the battery

◆ GetMaxCharge()

float csci3081::Battery::GetMaxCharge ( )

This function returns the max charge of the battery.

◆ GetRemainingLife()

float csci3081::Battery::GetRemainingLife ( )

This functions return the remaining life of the battery


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