Interface Tank
- All Known Subinterfaces:
IHeavyTank,ILightTank,ISelfPropelledArtillery
- All Known Implementing Classes:
HeavyTank,LightTank,SelfPropelledArtillery
public interface Tank
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancanShoot(PublicGameWorld world) default TankConfiggetConfig(PublicGameWorld world) default voidmove(PublicGameWorld world, Tank.MoveDirection direction) default voidmove(PublicGameWorld world, Tank.MoveDirection direction, double distance) Move the tank in the specified direction with the specified distance.default voidmoveTowards(PublicGameWorld world, Tank.MoveDirection moveDirection, Vec3 targetPosition, boolean simultaneous) Move the tank towards the target position in the specified move direction.default voidmoveTowards(PublicGameWorld world, Vec3 targetPosition, boolean simultaneous) default voidrotateBody(PublicGameWorld world, double angle) default voidrotateBodyTowards(PublicGameWorld world, Vec3 targetPosition) default voidrotateTurret(PublicGameWorld world, double yawAngle, double pitchAngle) default voidrotateTurretPitch(PublicGameWorld world, double pitchAngle) default voidrotateTurretTowards(PublicGameWorld world, Vec3 globalTarget) default voidrotateTurretYaw(PublicGameWorld world, double yawAngle) default booleanshoot(PublicGameWorld world)
-
Method Details
-
getTankType
TankType getTankType() -
getConfig
-
move
-
move
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
-
rotateBody
- Parameters:
world- The game world.angle- The angle to rotate in radians. (might get capped by the tank's rotation speed)
-
rotateBodyTowards
- Parameters:
world- The game world.targetPosition- The position to rotate the tank body towards.
-
rotateTurretYaw
-
rotateTurretPitch
-
rotateTurret
-
rotateTurretTowards
-
shoot
-
canShoot
-