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 aTankConfig
record class. -
Method Summary
Modifier and TypeMethodDescriptionarmor()
Returns the value of thearmor
record component.float
Returns the value of thebodyRotationSpeed
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.float
Returns the value of themaxHealth
record component.float
maxSlope()
Returns the value of themaxSlope
record component.float
Returns the value of themoveSpeed
record component.float
Returns the value of theprojectileDamage
record component.float
Returns the value of theprojectileGravity
record component.long
Returns the value of theprojectileLifetime
record component.Returns the value of theprojectileSize
record component.float
Returns the value of theprojectileSpeed
record component.long
Returns the value of therespawnTimer
record component.Returns the value of theshootCooldown
record component.size()
Returns the value of thesize
record component.final String
toString()
Returns a string representation of this record class.float
Returns the value of theturretMaxPitch
record component.float
Returns the value of theturretMinPitch
record component.float
Returns the value of theturretPitchRotationSpeed
record component.float
Returns the value of theturretYawRotationSpeed
record 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 aTankConfig
record class.- Parameters:
moveSpeed
- the value for themoveSpeed
record componentbodyRotationSpeed
- the value for thebodyRotationSpeed
record componentturretYawRotationSpeed
- the value for theturretYawRotationSpeed
record componentturretPitchRotationSpeed
- the value for theturretPitchRotationSpeed
record componentturretMaxPitch
- the value for theturretMaxPitch
record componentturretMinPitch
- the value for theturretMinPitch
record componentmaxSlope
- the value for themaxSlope
record componentsize
- the value for thesize
record componentshootCooldown
- the value for theshootCooldown
record componentprojectileDamage
- the value for theprojectileDamage
record componentprojectileSpeed
- the value for theprojectileSpeed
record componentprojectileLifetime
- the value for theprojectileLifetime
record componentprojectileSize
- the value for theprojectileSize
record componentmaxHealth
- the value for themaxHealth
record componentarmor
- the value for thearmor
record componentrespawnTimer
- the value for therespawnTimer
record componentprojectileGravity
- the value for theprojectileGravity
record 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 thecompare
method from their corresponding wrapper classes. -
moveSpeed
-
bodyRotationSpeed
public float bodyRotationSpeed()Returns the value of thebodyRotationSpeed
record component.- Returns:
- the value of the
bodyRotationSpeed
record component
-
turretYawRotationSpeed
public float turretYawRotationSpeed()Returns the value of theturretYawRotationSpeed
record component.- Returns:
- the value of the
turretYawRotationSpeed
record component
-
turretPitchRotationSpeed
public float turretPitchRotationSpeed()Returns the value of theturretPitchRotationSpeed
record component.- Returns:
- the value of the
turretPitchRotationSpeed
record component
-
turretMaxPitch
public float turretMaxPitch()Returns the value of theturretMaxPitch
record component.- Returns:
- the value of the
turretMaxPitch
record component
-
turretMinPitch
public float turretMinPitch()Returns the value of theturretMinPitch
record component.- Returns:
- the value of the
turretMinPitch
record component
-
maxSlope
-
size
-
shootCooldown
Returns the value of theshootCooldown
record component.- Returns:
- the value of the
shootCooldown
record component
-
projectileDamage
public float projectileDamage()Returns the value of theprojectileDamage
record component.- Returns:
- the value of the
projectileDamage
record component
-
projectileSpeed
public float projectileSpeed()Returns the value of theprojectileSpeed
record component.- Returns:
- the value of the
projectileSpeed
record component
-
projectileLifetime
public long projectileLifetime()Returns the value of theprojectileLifetime
record component.- Returns:
- the value of the
projectileLifetime
record component
-
projectileSize
Returns the value of theprojectileSize
record component.- Returns:
- the value of the
projectileSize
record component
-
maxHealth
-
armor
-
respawnTimer
public long respawnTimer()Returns the value of therespawnTimer
record component.- Returns:
- the value of the
respawnTimer
record component
-
projectileGravity
public float projectileGravity()Returns the value of theprojectileGravity
record component.- Returns:
- the value of the
projectileGravity
record component
-