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 boolean
canShoot
(PublicGameWorld world) default TankConfig
getConfig
(PublicGameWorld world) default void
move
(PublicGameWorld world, Tank.MoveDirection direction) default void
move
(PublicGameWorld world, Tank.MoveDirection direction, double distance) Move the tank in the specified direction with the specified distance.default void
moveTowards
(PublicGameWorld world, Tank.MoveDirection moveDirection, Vec3 targetPosition, boolean simultaneous) Move the tank towards the target position in the specified move direction.default void
moveTowards
(PublicGameWorld world, Vec3 targetPosition, boolean simultaneous) default void
rotateBody
(PublicGameWorld world, double angle) default void
rotateBodyTowards
(PublicGameWorld world, Vec3 targetPosition) default void
rotateTurret
(PublicGameWorld world, double yawAngle, double pitchAngle) default void
rotateTurretPitch
(PublicGameWorld world, double pitchAngle) default void
rotateTurretTowards
(PublicGameWorld world, Vec3 globalTarget) default void
rotateTurretYaw
(PublicGameWorld world, double yawAngle) default boolean
shoot
(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
-