Uses of Interface
battleship.IPosition
-
Uses of IPosition in battleship
Classes in battleship that implement IPositionFields in battleship with type parameters of type IPositionMethods in battleship that return IPositionModifier and TypeMethodDescriptionIShip.getPosition()Gets position.Ship.getPosition()Gets position.static IPositionTasks.readClassicPosition(@NotNull Scanner in) This operation allows reading a position in the mapMethods in battleship that return types with arguments of type IPositionModifier and TypeMethodDescriptionIPosition.adjacentPositions()Retrieves a list of positions that are adjacent to the current position.Position.adjacentPositions()Returns all valid adjacent positions (up, right, down, left) for this position.IShip.getAdjacentPositions()Gets positions.Ship.getAdjacentPositions()Retrieves a list of positions adjacent to the ship's current positions.IShip.getPositions()Gets positions.Ship.getPositions()Gets positions.IMove.getShots()Move.getShots()Methods in battleship with parameters of type IPositionModifier and TypeMethodDescriptionGame.fireSingleShot(IPosition pos, boolean isRepeated) Fires a single shot at the specified position, handling scenarios such as invalid positions, repeated shots, hits, misses, and sinking a ship.IGame.fireSingleShot(IPosition pos, boolean isRepeated) Fires a single shot at the specified position and indicates whether the shot is valid, repeated, and if it hit or sank a ship.booleanIPosition.isAdjacentTo(IPosition other) Is adjacent to boolean.booleanPosition.isAdjacentTo(IPosition other) Checks if this position is adjacent to another position.booleanOccupies boolean.booleanOccupies boolean.booleanGame.repeatedShot(IPosition pos) Ship at ship.Ship at ship.voidShoot.voidShoot.booleanIShip.tooCloseTo(IPosition pos) Too close to boolean.booleanShip.tooCloseTo(IPosition pos) Too close to boolean.Method parameters in battleship with type arguments of type IPositionModifier and TypeMethodDescriptionvoidFires a set of shots during a player's move.voidFires a set of shots in a given move.static StringSerializes a list of shot positions into a JSON string.Constructors in battleship with parameters of type IPositionModifierConstructorDescriptionInstantiates a new Barge.Instantiates a new Caravel.Instantiates a new Carrack.Instantiates a new Frigate.Instantiates a new Galleon.Create shipsConstructor parameters in battleship with type arguments of type IPositionModifierConstructorDescriptionMove(int moveNumber, List<IPosition> moveShots, List<IGame.ShotResult> moveResults)