Class Blockade

  • All Implemented Interfaces:
    IBlockade

    public class Blockade
    extends java.lang.Object
    implements IBlockade
    Author:
    Andi Hotz, (c) Sahits GmbH, 2016 Created on Apr 14, 2016
    • Constructor Detail

      • Blockade

        public Blockade​(java.time.LocalDateTime assemblyDate,
                        java.time.LocalDateTime endBlockade)
    • Method Detail

      • getBlockadeConvoy

        public IConvoy getBlockadeConvoy()
        Description copied from interface: IBlockade
        Retrieve the blockade convoy
        Specified by:
        getBlockadeConvoy in interface IBlockade
        Returns:
        convoy fleet executing the blockade
      • getShips

        public java.util.List<IShip> getShips​(IPlayer player)
        Description copied from interface: IBlockade
        Retrieve the ships of a certain player.
        Specified by:
        getShips in interface IBlockade
        Parameters:
        player - for which to retrieve the ships
        Returns:
        List of ships of the player in the blockade convoy
      • getShips

        public java.util.List<IShip> getShips()
        Description copied from interface: IBlockade
        Retrieve all ships for the blockade.
        Specified by:
        getShips in interface IBlockade
        Returns:
        list of ships in the convoy.
      • requestShip

        public void requestShip​(IPlayer player,
                                int number)
      • getNumberOfRequestedShips

        public int getNumberOfRequestedShips​(IPlayer player)
        Description copied from interface: IBlockade
        Retrieve the number of ships that are requested.
        Specified by:
        getNumberOfRequestedShips in interface IBlockade
        Parameters:
        player - for whom to retrieve the number of requested ships
        Returns:
        number of requested ships from player
      • getPlayersWithRequestedShips

        public java.util.List<IPlayer> getPlayersWithRequestedShips()
        Description copied from interface: IBlockade
        Retrieve a list of players which have requested a ship
        Specified by:
        getPlayersWithRequestedShips in interface IBlockade
        Returns:
        list of player who should provide ships for the blockade convoy
      • addShips

        public void addShips​(IPlayer player,
                             java.util.List<IShip> shipList)
        Description copied from interface: IBlockade
        Add a number of ships for a player to the blockade.
        Specified by:
        addShips in interface IBlockade
        Parameters:
        player - for whom to add ships to the blockade convoy
        shipList - list of ships to be added