Class Islands


  • public class Islands
    extends java.lang.Object
    A class offering common operations on islands and regions.
    • Constructor Detail

      • Islands

        public Islands()
    • Method Detail

      • getIslands

        public static java.util.Map<IntegerID,​Island> getIslands​(UserInterface ui,
                                                                       GameData data)
        Retrieve all islands formed by a collection of regions. This method will try to expand and merge islands already present in the data.
        Parameters:
        data - the game data as required by the Island constructor.
      • getIslands

        @Deprecated
        public static java.util.Map<IntegerID,​Island> getIslands​(UserInterface ui,
                                                                       Rules rules,
                                                                       java.util.Map<CoordinateID,​Region> regions,
                                                                       java.util.Map<IntegerID,​Island> oldIslands,
                                                                       GameData data)
        Deprecated.
        Retrieve all islands formed by a collection of regions.
        Parameters:
        rules - the rules to retrieve the ocean region type from.
        regions - the regions the islands consist of.
        oldIslands - islands contained in this map are regarded as already existing. They can be expanded or merged, depending on the regions supplied. To indicate that no islands are known supply an empty map or null.
        data - the game data as required by the Island constructor.
      • getIsland

        public static java.util.Map<CoordinateID,​Region> getIsland​(Rules rules,
                                                                         java.util.Map<CoordinateID,​Region> regions,
                                                                         Region r)
        Get all regions belonging the same island as the region r. Uses all the "land regions" from the rule.
        Parameters:
        regions - All regions that could possibly belong to the island.
        r - A region forming an island with its neighbouring regions.
        Returns:
        a map containing all regions that can be reached from region r via allowed land region types
      • getIsland

        @Deprecated
        public static java.util.Map<CoordinateID,​Region> getIsland​(Rules rules,
                                                                         java.util.Map<CoordinateID,​Region> regions,
                                                                         Region r,
                                                                         java.util.Map<ID,​RegionType> excludedRegionTypes)
        Get all regions belonging the same island as the region r.
        Parameters:
        regions - All regions that could possibly belong to the island.
        r - A region forming an island with its neighbouring regions.
        excludedRegionTypes - Additional region types which should not be included (e.g. Feuerwand)
        Returns:
        a map containing all regions that can be reached from region r via allowed region types
      • getIsland

        public static java.util.Map<CoordinateID,​Region> getIsland​(Rules rules,
                                                                         java.util.Map<CoordinateID,​Region> regions,
                                                                         Region r,
                                                                         java.util.Map<ID,​RegionType> excludedRegionTypes,
                                                                         boolean onlyLand)
        Get all regions belonging the same island as the region r.
        Parameters:
        regions - all regions that could possibly belong to the island.
        r - a region forming an island with its neighbouring regions.
        excludedRegionTypes - additional regiontypes which should not be included (e.g. Feuerwand)
        onlyLand - if true, all region types from Regions.getNonLandRegionTypes(Rules) will be excluded.
        Returns:
        a map containing all regions that can be reached from region r via allowed region types