Class CitiesState
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.city.impl.CitiesState
-
@Component @Lazy @DependentInitialisation(MapInitializedBean.class) public class CitiesState extends java.lang.Object
State common to all cities.- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Feb 1, 2013
-
-
Constructor Summary
Constructors Constructor Description CitiesState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCity(ICity city, CityState cityState)Add a new city.java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>>findCityWithMostNeededWare()Find a possible city that has needed wares.java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>>findCityWithSurplusWare()Find a possible city that has needed wares.java.util.List<CityState>getCityEngineStates()voidinit()
-
-
-
Method Detail
-
init
public void init()
-
addCity
public void addCity(ICity city, CityState cityState)
Add a new city.- Parameters:
city- for which to add aCityStatecityState- to be added
-
findCityWithMostNeededWare
public java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> findCityWithMostNeededWare()
Find a possible city that has needed wares. Repeated calls to this method are not garanteed to return the same city.- Returns:
- Optional
GenericPairof city and ware.
-
findCityWithSurplusWare
public java.util.Optional<ch.sahits.datastructure.GenericPair<ICity,IWare>> findCityWithSurplusWare()
Find a possible city that has needed wares. Repeated calls to this method are not garanteed to return the same city.- Returns:
- Optional
GenericPairof city and ware.
-
getCityEngineStates
public java.util.List<CityState> getCityEngineStates()
-
-