|
|
| 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.
|
| |
◆ 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] | batteryType | optional; there are 2 types of batteries: carrier and recharging_drone. Recharging drone has higher maxCharge than carrier. Default of batterType is carrier. |
◆ Charging()
| bool csci3081::Battery::Charging |
( |
float |
sec | ) |
|
Charging The Battery.
- Parameters
-
| [in] | sec | seconds battery is charged |
| [out] | True | if 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] | sec | seconds 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:
- /home/user/repo/project/include/battery.h
- /home/user/repo/project/src/battery.cc