NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
tank.h
Go to the documentation of this file.
1#ifndef TANK_H
2#define TANK_H
3
19class Tank {
20private:
22 double tankMaxCapacity; // Maximum capacity of the tank in liters
23 double tankInitialCapacity; // Initial capacity of the tank in liters
24 double tankCurrentCapacity; // Current capacity of the tank in liters
25 double tankStateOfCapacity; // State of capacity of the tank
26 double tankDOD; // Depth of discharge
27 double tankCumConsumedFuel = 0.0; // Total consumed amount of fuel in liters
28
29public:
39 void SetTank(double maxCapacity, double initialCapacityPercentage, double depthOfDischarge);
40
46 double getTankMaxCapacity() const;
47
53 void setTankMaxCapacity(double newMaxCapacity);
54
60 double getTankInitialCapacity() const;
61
67 void setTankInitialCapacity(double newInitialCapacityPercentage);
68
74 double getTankCurrentCapacity() const;
75
82 double consumeTank(double consumedAmount);
83
89 double getTankStateOfCapacity() const;
90
97 bool isTankDrainable(double consumedAmount);
98
104 double getTankDOD() const;
105
111 void setTankDOD(double newTankDOD);
112
118 bool tankHasFuel();
119
125 double getTankCumConsumedFuel() const;
126};
127
128#endif // TANK_H
Definition tank.h:19
double getTankDOD() const
Gets the depth of discharge of the tank.
Definition tank.cpp:40
void SetTank(double maxCapacity, double initialCapacityPercentage, double depthOfDischarge)
Set the main properties of the tank (initialize the tank)
Definition tank.cpp:64
bool isTankDrainable(double consumedAmount)
Checks if the specified amount of fuel is drainable from the tank.
Definition tank.cpp:36
double consumeTank(double consumedAmount)
Consumes fuel from the tank.
Definition tank.cpp:24
bool tankHasFuel()
Checks if the tank has fuel (current capacity > 0)
Definition tank.cpp:60
double getTankInitialCapacity() const
Gets the initial capacity of the tank.
Definition tank.cpp:12
double getTankStateOfCapacity() const
Gets the state of capacity of the tank.
Definition tank.cpp:32
void setTankMaxCapacity(double newMaxCapacity)
Sets the maximum capacity of the tank.
Definition tank.cpp:8
void setTankInitialCapacity(double newInitialCapacityPercentage)
Sets the initial capacity of the tank.
Definition tank.cpp:16
void setTankDOD(double newTankDOD)
Sets the depth of discharge of the tank.
Definition tank.cpp:44
double getTankCumConsumedFuel() const
Gets the total amount of fuel consumed from the tank.
Definition tank.cpp:56
double getTankCurrentCapacity() const
Gets the current capacity of the tank.
Definition tank.cpp:20
double getTankMaxCapacity() const
Gets the maximum capacity of the tank.
Definition tank.cpp:4