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 tick
bodyRotationSpeed - the speed at which the tank can rotate left and right per tick
turretYawRotationSpeed - the speed at which the turret can rotate left and right per tick
turretPitchRotationSpeed - the speed at which the turret can rotate up and down per tick
turretMaxPitch - the maximum pitch the turret can have
turretMinPitch - the minimum pitch the turret can have
maxSlope - 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 shots
projectileDamage - how much damage the projectile does
projectileSpeed - how fast the projectile moves per tick
projectileLifetime - how many ticks the projectile lives
projectileSize - the size of the projectile (half extents)
maxHealth - the maximum health the tank can have
armor - 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 respawning
projectileGravity - 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 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 a TankConfig record class.
      Parameters:
      moveSpeed - the value for the moveSpeed record component
      bodyRotationSpeed - the value for the bodyRotationSpeed record component
      turretYawRotationSpeed - the value for the turretYawRotationSpeed record component
      turretPitchRotationSpeed - the value for the turretPitchRotationSpeed record component
      turretMaxPitch - the value for the turretMaxPitch record component
      turretMinPitch - the value for the turretMinPitch record component
      maxSlope - the value for the maxSlope record component
      size - the value for the size record component
      shootCooldown - the value for the shootCooldown record component
      projectileDamage - the value for the projectileDamage record component
      projectileSpeed - the value for the projectileSpeed record component
      projectileLifetime - the value for the projectileLifetime record component
      projectileSize - the value for the projectileSize record component
      maxHealth - the value for the maxHealth record component
      armor - the value for the armor record component
      respawnTimer - the value for the respawnTimer record component
      projectileGravity - the value for the projectileGravity record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • moveSpeed

      public float moveSpeed()
      Returns the value of the moveSpeed record component.
      Returns:
      the value of the moveSpeed record component
    • bodyRotationSpeed

      public float bodyRotationSpeed()
      Returns the value of the bodyRotationSpeed record component.
      Returns:
      the value of the bodyRotationSpeed record component
    • turretYawRotationSpeed

      public float turretYawRotationSpeed()
      Returns the value of the turretYawRotationSpeed record component.
      Returns:
      the value of the turretYawRotationSpeed record component
    • turretPitchRotationSpeed

      public float turretPitchRotationSpeed()
      Returns the value of the turretPitchRotationSpeed record component.
      Returns:
      the value of the turretPitchRotationSpeed record component
    • turretMaxPitch

      public float turretMaxPitch()
      Returns the value of the turretMaxPitch record component.
      Returns:
      the value of the turretMaxPitch record component
    • turretMinPitch

      public float turretMinPitch()
      Returns the value of the turretMinPitch record component.
      Returns:
      the value of the turretMinPitch record component
    • maxSlope

      public float maxSlope()
      Returns the value of the maxSlope record component.
      Returns:
      the value of the maxSlope record component
    • size

      public Vec3 size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • shootCooldown

      public Long shootCooldown()
      Returns the value of the shootCooldown record component.
      Returns:
      the value of the shootCooldown record component
    • projectileDamage

      public float projectileDamage()
      Returns the value of the projectileDamage record component.
      Returns:
      the value of the projectileDamage record component
    • projectileSpeed

      public float projectileSpeed()
      Returns the value of the projectileSpeed record component.
      Returns:
      the value of the projectileSpeed record component
    • projectileLifetime

      public long projectileLifetime()
      Returns the value of the projectileLifetime record component.
      Returns:
      the value of the projectileLifetime record component
    • projectileSize

      public Vec3 projectileSize()
      Returns the value of the projectileSize record component.
      Returns:
      the value of the projectileSize record component
    • maxHealth

      public float maxHealth()
      Returns the value of the maxHealth record component.
      Returns:
      the value of the maxHealth record component
    • armor

      public HashMap<Side,Float> armor()
      Returns the value of the armor record component.
      Returns:
      the value of the armor record component
    • respawnTimer

      public long respawnTimer()
      Returns the value of the respawnTimer record component.
      Returns:
      the value of the respawnTimer record component
    • projectileGravity

      public float projectileGravity()
      Returns the value of the projectileGravity record component.
      Returns:
      the value of the projectileGravity record component