Class VehicleStatics
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.statics.VehicleStatics
Statics of a vehicle
Some values are fixed for the StorageVehicle
Some values are dynamic and will be changed when the vehicle is a DriveableVehicle+
-
Constructor Summary
ConstructorsConstructorDescriptionVehicleStatics
(VehicleModel model) Construct a VehicleStatics instance for a VehicleModel -
Method Summary
Modifier and TypeMethodDescriptionvoid
forceSetAcceleration
(float acceleration) Force set the current acceleration (overwrites the modifier value)void
forceSetBrakeForce
(float brakeForce) Force set the current brake force (overwrites the modifier value)void
forceSetCurrentHealth
(int currentHealth) Force set the current health (overwrites the modifier value)void
forceSetFuelTank
(int fuelTank) Force set the current fuel (overwrites the modifier value)void
forceSetMaxSpeed
(int maxSpeed) Force set the max speed (overwrites the modifier value)void
forceSetTurningRadius
(float turningRadius) Force set the current turning radius (overwrites the modifier value)float
Get the acceleration of the vehicle including modifiersfloat
A modifier added to the acceleration (positive or negative)float
Get the brake force of the vehicle including modifiersfloat
A modifier added to the brake force (positive or negative)double
The current fuel of the vehicle in litersint
The current health of the vehiclefloat
The current speed of the vehicleint
Get the current speed in km/h This value will never be negativefloat
The current steering of the vehicle in degreesint
Get the fuel tank of the vehicle in liters including modifiersint
A modifier added to the fuel tank (positive or negative)int
Get the maximum speed of the vehicle in km/h including modifiersint
A modifier added to the max speed (positive or negative)float
Get the turning radius of the vehicle in degrees including modifiersfloat
A modifier added to the turning radius (positive or negative)boolean
isBroken()
If the vehicle is brokenboolean
isMoving()
Check if the vehicle is movingvoid
Reset the moving values of the vehicle (currentSpeed and currentSteering)void
setAccelerationModifier
(float accelerationModifier) A modifier added to the acceleration (positive or negative)void
setBrakeForceModifier
(float brakeForceModifier) A modifier added to the brake force (positive or negative)void
setBroken
(boolean broken) If the vehicle is brokenvoid
setCurrentFuel
(double currentFuel) The current fuel of the vehicle in litersvoid
setCurrentHealth
(int currentHealth) The current health of the vehiclevoid
setCurrentSpeed
(float currentSpeed) The current speed of the vehiclevoid
setCurrentSteering
(float currentSteering) The current steering of the vehicle in degreesvoid
setFuelTankModifier
(int fuelTankModifier) A modifier added to the fuel tank (positive or negative)void
setMaxSpeedModifier
(int maxSpeedModifier) A modifier added to the max speed (positive or negative)void
setTurningRadiusModifier
(float turningRadiusModifier) A modifier added to the turning radius (positive or negative)toString()
-
Constructor Details
-
VehicleStatics
Construct a VehicleStatics instance for a VehicleModel- Parameters:
model
- The VehicleModel
-
-
Method Details
-
getMaxSpeed
public int getMaxSpeed()Get the maximum speed of the vehicle in km/h including modifiers- Returns:
- The maximum speed in km/h
-
getTurningRadius
public float getTurningRadius()Get the turning radius of the vehicle in degrees including modifiers- Returns:
- The turning radius in degrees
-
getFuelTank
public int getFuelTank()Get the fuel tank of the vehicle in liters including modifiers- Returns:
- The fuel tank in liters
-
getAcceleration
public float getAcceleration()Get the acceleration of the vehicle including modifiers- Returns:
- The acceleration
-
getBrakeForce
public float getBrakeForce()Get the brake force of the vehicle including modifiers- Returns:
- The brake force
-
forceSetMaxSpeed
public void forceSetMaxSpeed(int maxSpeed) Force set the max speed (overwrites the modifier value) -
forceSetCurrentHealth
public void forceSetCurrentHealth(int currentHealth) Force set the current health (overwrites the modifier value) -
forceSetTurningRadius
public void forceSetTurningRadius(float turningRadius) Force set the current turning radius (overwrites the modifier value) -
forceSetFuelTank
public void forceSetFuelTank(int fuelTank) Force set the current fuel (overwrites the modifier value) -
forceSetAcceleration
public void forceSetAcceleration(float acceleration) Force set the current acceleration (overwrites the modifier value) -
forceSetBrakeForce
public void forceSetBrakeForce(float brakeForce) Force set the current brake force (overwrites the modifier value) -
getCurrentSpeedKMPH
public int getCurrentSpeedKMPH()Get the current speed in km/h This value will never be negative- Returns:
- The current speed in km/h
-
isMoving
public boolean isMoving()Check if the vehicle is moving- Returns:
- true if the vehicle is moving
-
resetMovingValues
public void resetMovingValues()Reset the moving values of the vehicle (currentSpeed and currentSteering) -
getMaxSpeedModifier
public int getMaxSpeedModifier()A modifier added to the max speed (positive or negative) -
getTurningRadiusModifier
public float getTurningRadiusModifier()A modifier added to the turning radius (positive or negative) -
getFuelTankModifier
public int getFuelTankModifier()A modifier added to the fuel tank (positive or negative) -
getAccelerationModifier
public float getAccelerationModifier()A modifier added to the acceleration (positive or negative) -
getBrakeForceModifier
public float getBrakeForceModifier()A modifier added to the brake force (positive or negative) -
getCurrentHealth
public int getCurrentHealth()The current health of the vehicle -
getCurrentFuel
public double getCurrentFuel()The current fuel of the vehicle in liters -
isBroken
public boolean isBroken()If the vehicle is broken -
getCurrentSpeed
public float getCurrentSpeed()The current speed of the vehicle -
getCurrentSteering
public float getCurrentSteering()The current steering of the vehicle in degrees -
setMaxSpeedModifier
public void setMaxSpeedModifier(int maxSpeedModifier) A modifier added to the max speed (positive or negative) -
setTurningRadiusModifier
public void setTurningRadiusModifier(float turningRadiusModifier) A modifier added to the turning radius (positive or negative) -
setFuelTankModifier
public void setFuelTankModifier(int fuelTankModifier) A modifier added to the fuel tank (positive or negative) -
setAccelerationModifier
public void setAccelerationModifier(float accelerationModifier) A modifier added to the acceleration (positive or negative) -
setBrakeForceModifier
public void setBrakeForceModifier(float brakeForceModifier) A modifier added to the brake force (positive or negative) -
setCurrentHealth
public void setCurrentHealth(int currentHealth) The current health of the vehicle -
setCurrentFuel
public void setCurrentFuel(double currentFuel) The current fuel of the vehicle in liters -
setBroken
public void setBroken(boolean broken) If the vehicle is broken -
setCurrentSpeed
public void setCurrentSpeed(float currentSpeed) The current speed of the vehicle -
setCurrentSteering
public void setCurrentSteering(float currentSteering) The current steering of the vehicle in degrees -
toString
-