Record Class TankConfig
java.lang.Object
java.lang.Record
dev.zwazel.internal.game.tank.TankConfig
- Record Components:
moveSpeed- the speed at which the tank can move forward and backward per tickbodyRotationSpeed- the speed at which the tank can rotate left and right per tickturretYawRotationSpeed- the speed at which the turret can rotate left and right per tickturretPitchRotationSpeed- the speed at which the turret can rotate up and down per tickturretMaxPitch- the maximum pitch the turret can haveturretMinPitch- the minimum pitch the turret can havemaxSlope- the maximum slope the tank can drive on ("climb" up)size- the size of the tank (full extents)shootCooldown- how many ticks the tank has to wait between shotsprojectileDamage- how much damage the projectile doesprojectileSpeed- how fast the projectile moves per tickprojectileLifetime- how many ticks the projectile livesprojectileSize- the size of the projectile (half extents)maxHealth- the maximum health the tank can havearmor- the armor of the tank on each side (0-1, 0 = no armor, 1 = full armor) Damage is reduced by the armor value on the side that was hit calculated as: damage = damage * (1 - armor)respawnTimer- how many ticks the tank has to wait before respawningprojectileGravity- how much the projectile is affected by gravity (if 0, no gravity)
public record TankConfig(float moveSpeed, float bodyRotationSpeed, float turretYawRotationSpeed, float turretPitchRotationSpeed, float turretMaxPitch, float turretMinPitch, float maxSlope, Vec3 size, Long shootCooldown, float projectileDamage, float projectileSpeed, long projectileLifetime, Vec3 projectileSize, float maxHealth, HashMap<Side,Float> armor, long respawnTimer, float projectileGravity)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionTankConfig(float moveSpeed, float bodyRotationSpeed, float turretYawRotationSpeed, float turretPitchRotationSpeed, float turretMaxPitch, float turretMinPitch, float maxSlope, Vec3 size, Long shootCooldown, float projectileDamage, float projectileSpeed, long projectileLifetime, Vec3 projectileSize, float maxHealth, HashMap<Side, Float> armor, long respawnTimer, float projectileGravity) Creates an instance of aTankConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionarmor()Returns the value of thearmorrecord component.floatReturns the value of thebodyRotationSpeedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatReturns the value of themaxHealthrecord component.floatmaxSlope()Returns the value of themaxSloperecord component.floatReturns the value of themoveSpeedrecord component.floatReturns the value of theprojectileDamagerecord component.floatReturns the value of theprojectileGravityrecord component.longReturns the value of theprojectileLifetimerecord component.Returns the value of theprojectileSizerecord component.floatReturns the value of theprojectileSpeedrecord component.longReturns the value of therespawnTimerrecord component.Returns the value of theshootCooldownrecord component.size()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of theturretMaxPitchrecord component.floatReturns the value of theturretMinPitchrecord component.floatReturns the value of theturretPitchRotationSpeedrecord component.floatReturns the value of theturretYawRotationSpeedrecord component.
-
Constructor Details
-
TankConfig
public TankConfig(float moveSpeed, float bodyRotationSpeed, float turretYawRotationSpeed, float turretPitchRotationSpeed, float turretMaxPitch, float turretMinPitch, float maxSlope, Vec3 size, Long shootCooldown, float projectileDamage, float projectileSpeed, long projectileLifetime, Vec3 projectileSize, float maxHealth, HashMap<Side, Float> armor, long respawnTimer, float projectileGravity) Creates an instance of aTankConfigrecord class.- Parameters:
moveSpeed- the value for themoveSpeedrecord componentbodyRotationSpeed- the value for thebodyRotationSpeedrecord componentturretYawRotationSpeed- the value for theturretYawRotationSpeedrecord componentturretPitchRotationSpeed- the value for theturretPitchRotationSpeedrecord componentturretMaxPitch- the value for theturretMaxPitchrecord componentturretMinPitch- the value for theturretMinPitchrecord componentmaxSlope- the value for themaxSloperecord componentsize- the value for thesizerecord componentshootCooldown- the value for theshootCooldownrecord componentprojectileDamage- the value for theprojectileDamagerecord componentprojectileSpeed- the value for theprojectileSpeedrecord componentprojectileLifetime- the value for theprojectileLifetimerecord componentprojectileSize- the value for theprojectileSizerecord componentmaxHealth- the value for themaxHealthrecord componentarmor- the value for thearmorrecord componentrespawnTimer- the value for therespawnTimerrecord componentprojectileGravity- the value for theprojectileGravityrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
moveSpeed
-
bodyRotationSpeed
public float bodyRotationSpeed()Returns the value of thebodyRotationSpeedrecord component.- Returns:
- the value of the
bodyRotationSpeedrecord component
-
turretYawRotationSpeed
public float turretYawRotationSpeed()Returns the value of theturretYawRotationSpeedrecord component.- Returns:
- the value of the
turretYawRotationSpeedrecord component
-
turretPitchRotationSpeed
public float turretPitchRotationSpeed()Returns the value of theturretPitchRotationSpeedrecord component.- Returns:
- the value of the
turretPitchRotationSpeedrecord component
-
turretMaxPitch
public float turretMaxPitch()Returns the value of theturretMaxPitchrecord component.- Returns:
- the value of the
turretMaxPitchrecord component
-
turretMinPitch
public float turretMinPitch()Returns the value of theturretMinPitchrecord component.- Returns:
- the value of the
turretMinPitchrecord component
-
maxSlope
-
size
-
shootCooldown
Returns the value of theshootCooldownrecord component.- Returns:
- the value of the
shootCooldownrecord component
-
projectileDamage
public float projectileDamage()Returns the value of theprojectileDamagerecord component.- Returns:
- the value of the
projectileDamagerecord component
-
projectileSpeed
public float projectileSpeed()Returns the value of theprojectileSpeedrecord component.- Returns:
- the value of the
projectileSpeedrecord component
-
projectileLifetime
public long projectileLifetime()Returns the value of theprojectileLifetimerecord component.- Returns:
- the value of the
projectileLifetimerecord component
-
projectileSize
Returns the value of theprojectileSizerecord component.- Returns:
- the value of the
projectileSizerecord component
-
maxHealth
-
armor
-
respawnTimer
public long respawnTimer()Returns the value of therespawnTimerrecord component.- Returns:
- the value of the
respawnTimerrecord component
-
projectileGravity
public float projectileGravity()Returns the value of theprojectileGravityrecord component.- Returns:
- the value of the
projectileGravityrecord component
-