Interface IConvoy

  • All Superinterfaces:
    IGroupableVessel, INavigableVessel
    All Known Implementing Classes:
    Convoy

    public interface IConvoy
    extends IGroupableVessel
    A convoy is a special representation of a ship. A convoy is put together by a lead ship and optionally other ships. These ships may belong to other players. Any gain or loss will be distributed unto the ships according to their capacity.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 17, 2011
    • Method Detail

      • hasWeapons

        boolean hasWeapons()
        Though a convoy has always weapons this is only something that is handled on the level of a single ship. Therefore this method will always return false.
        Returns:
        false
      • getOrlegShip

        IShip getOrlegShip()
        Retrieve the lead ship of the convoy.
        Returns:
        reference to the orleg ship.
      • getShips

        java.util.List<IShip> getShips()
        Retrieve a list of the ships in the convoy.
        Specified by:
        getShips in interface IGroupableVessel
        Returns:
        list of ships in the convoy.
      • getShips

        java.util.List<IShip> getShips​(IPlayer player)
        Get all the ships in the convoi that belong to a player.
        Parameters:
        player - who owns the ships
        Returns:
        possible empty list of ships.
      • getPlayers

        java.util.List<IPlayer> getPlayers()
        Get all players who have a ship in the convoy.
        Returns:
        list of players.
      • addShip

        void addShip​(IShip ship)
        Add a ship to the convoy.
        Parameters:
        ship - to be added.
      • removeShip

        void removeShip​(IShip ship)
        Remove a ship from the convoy.
        Parameters:
        ship - to be removed.
      • getCapacityPerOwner

        java.util.Map<IPlayer,​java.lang.Integer> getCapacityPerOwner()
        Collect the convoys capacity per player who has ships in the convoy.
        Returns:
        map of IPlayer to capacity.
      • isPublicConvoy

        boolean isPublicConvoy()
        Indicates that everyone can join this convoy.
        Returns:
        true if the convoy is a public convoy.