Class GameMap
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.map.impl.GameMap
-
- All Implemented Interfaces:
IMap
@Component @Lazy @DependentInitialisation(StartNewGameBean.class) public class GameMap extends java.lang.Object implements IMap
Implementation of the game map. This singleton is instaniated by the Game Factory.- Author:
- Andi Hotz, (c) Sahits GmbH, 2011 Created on Sep 16, 2011
-
-
Constructor Summary
Constructors Constructor Description GameMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ICity city)Add a new city.voidaddTradeRoute(ITradeRoute tradeRoute)ICityfindCity(java.lang.String cityName)Find a city by its name.java.util.Optional<ICity>findCity(javafx.geometry.Point2D location)Find the city at the given coordinates.java.util.List<ICity>getCities()Retrieve an unmodifiable list of all the cities in the mapjava.util.List<ICity>getCities(IPlayer player)Retrieve an unmodifiable list of all the cities in the map also including the once only visible to the player.intgetNumberCities()Retrieve the number of cities that are on the map.voidsetup(java.util.Collection<ICity> cities, javafx.geometry.Dimension2D dim, java.lang.String mapName, java.lang.String bwImageName, double numberOfPixelPerKilometer)Initialize the map by means of a list of its cities.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ch.sahits.game.openpatrician.model.map.IMap
getCityCoordinates, getDimension, getFutureTowns, getLandbridges, getMapBWImagePath, getMapImagePath, getNumberOfPixelPerKilometer, getPirateNests, getTownsInFounding, getTradeRoutes
-
-
-
-
Method Detail
-
setup
public void setup(java.util.Collection<ICity> cities, javafx.geometry.Dimension2D dim, java.lang.String mapName, java.lang.String bwImageName, double numberOfPixelPerKilometer)
Initialize the map by means of a list of its cities.- Parameters:
cities- List of cities for which to set up the mapdim- dimensions of the mapbwImageName- black and white image filename distinguishing land and seamapName- image filenamenumberOfPixelPerKilometer- ratio of pixels that make up one km on the map
-
getNumberCities
public int getNumberCities()
Description copied from interface:IMapRetrieve the number of cities that are on the map.- Specified by:
getNumberCitiesin interfaceIMap- Returns:
- number of cities on the map.
-
getCities
public java.util.List<ICity> getCities()
Description copied from interface:IMapRetrieve an unmodifiable list of all the cities in the map
-
findCity
public ICity findCity(java.lang.String cityName)
Description copied from interface:IMapFind a city by its name.
-
getCities
public java.util.List<ICity> getCities(IPlayer player)
Description copied from interface:IMapRetrieve an unmodifiable list of all the cities in the map also including the once only visible to the player.
-
findCity
public java.util.Optional<ICity> findCity(javafx.geometry.Point2D location)
Description copied from interface:IMapFind the city at the given coordinates.
-
addTradeRoute
public void addTradeRoute(ITradeRoute tradeRoute)
-
-