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 TypeMethodDescriptionvoidforceSetAcceleration(float acceleration) Force set the current acceleration (overwrites the modifier value)voidforceSetBrakeForce(float brakeForce) Force set the current brake force (overwrites the modifier value)voidforceSetCurrentHealth(int currentHealth) Force set the current health (overwrites the modifier value)voidforceSetFuelTank(int fuelTank) Force set the current fuel (overwrites the modifier value)voidforceSetMaxSpeed(int maxSpeed) Force set the max speed (overwrites the modifier value)voidforceSetTurningRadius(float turningRadius) Force set the current turning radius (overwrites the modifier value)floatGet the acceleration of the vehicle including modifiersfloatA modifier added to the acceleration (positive or negative)floatGet the brake force of the vehicle including modifiersfloatA modifier added to the brake force (positive or negative)doubleThe current fuel of the vehicle in litersintThe current health of the vehiclefloatThe current speed of the vehicleintGet the current speed in km/h This value will never be negativefloatThe current steering of the vehicle in degreesintGet the fuel tank of the vehicle in liters including modifiersintA modifier added to the fuel tank (positive or negative)intGet the maximum speed of the vehicle in km/h including modifiersintA modifier added to the max speed (positive or negative)floatGet the turning radius of the vehicle in degrees including modifiersfloatA modifier added to the turning radius (positive or negative)booleanisBroken()If the vehicle is brokenbooleanisMoving()Check if the vehicle is movingvoidReset the moving values of the vehicle (currentSpeed and currentSteering)voidsetAccelerationModifier(float accelerationModifier) A modifier added to the acceleration (positive or negative)voidsetBrakeForceModifier(float brakeForceModifier) A modifier added to the brake force (positive or negative)voidsetBroken(boolean broken) If the vehicle is brokenvoidsetCurrentFuel(double currentFuel) The current fuel of the vehicle in litersvoidsetCurrentHealth(int currentHealth) The current health of the vehiclevoidsetCurrentSpeed(float currentSpeed) The current speed of the vehiclevoidsetCurrentSteering(float currentSteering) The current steering of the vehicle in degreesvoidsetFuelTankModifier(int fuelTankModifier) A modifier added to the fuel tank (positive or negative)voidsetMaxSpeedModifier(int maxSpeedModifier) A modifier added to the max speed (positive or negative)voidsetTurningRadiusModifier(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
-