Interface Tank

All Known Subinterfaces:
IHeavyTank, ILightTank, ISelfPropelledArtillery
All Known Implementing Classes:
HeavyTank, LightTank, SelfPropelledArtillery

public interface Tank
  • Method Details

    • getTankType

      TankType getTankType()
    • getConfig

      default TankConfig getConfig(PublicGameWorld world)
    • move

      default void move(PublicGameWorld world, Tank.MoveDirection direction)
    • move

      default void move(PublicGameWorld world, Tank.MoveDirection direction, double distance)
      Move the tank in the specified direction with the specified distance.
      Parameters:
      world - The game world.
      direction - The direction to move the tank in (forward or backward).
      distance - The distance to move the tank by. If the distance is greater than the tank's move speed, the tank will only move by the move speed.
    • moveTowards

      default void moveTowards(PublicGameWorld world, Tank.MoveDirection moveDirection, Vec3 targetPosition, boolean simultaneous)
      Move the tank towards the target position in the specified move direction. If moving forward, the tank's forward vector will be aligned towards the target. If moving backwards, the tank will be rotated such that its rear faces the target. The boolean parameter 'simultaneous' controls whether the tank rotates and moves at the same time. When false, the tank will only move if its alignment to the target is within a set threshold.
      Parameters:
      world - The game world.
      moveDirection - The direction to move (FORWARD or BACKWARDS).
      targetPosition - The target position to approach.
      simultaneous - If true, rotate and move concurrently; if false, only move when aligned.
    • moveTowards

      default void moveTowards(PublicGameWorld world, Vec3 targetPosition, boolean simultaneous)
    • rotateBody

      default void rotateBody(PublicGameWorld world, double angle)
      Parameters:
      world - The game world.
      angle - The angle to rotate in radians. (might get capped by the tank's rotation speed)
    • rotateBodyTowards

      default void rotateBodyTowards(PublicGameWorld world, Vec3 targetPosition)
      Parameters:
      world - The game world.
      targetPosition - The position to rotate the tank body towards.
    • rotateTurretYaw

      default void rotateTurretYaw(PublicGameWorld world, double yawAngle)
    • rotateTurretPitch

      default void rotateTurretPitch(PublicGameWorld world, double pitchAngle)
    • rotateTurret

      default void rotateTurret(PublicGameWorld world, double yawAngle, double pitchAngle)
    • rotateTurretTowards

      default void rotateTurretTowards(PublicGameWorld world, Vec3 globalTarget)
    • shoot

      default boolean shoot(PublicGameWorld world)
    • canShoot

      default boolean canShoot(PublicGameWorld world)