Class BlockadeState
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.sea.BlockadeState
-
public class BlockadeState extends java.lang.Object
Hold the state of all current blockades- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Apr 14, 2016
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<ICity,IBlockade>
blockadedCity
-
Constructor Summary
Constructors Constructor Description BlockadeState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlockade(ICity city, IBlockade blockade)
Add a blockade for the city.java.util.Set<java.util.Map.Entry<ICity,IBlockade>>
entrySet()
void
finishBlockade(ICity city)
Finish the blockade.java.util.Optional<IBlockade>
getBlockade(ICity city)
Retrieve the blockade for the city.
-
-
-
Method Detail
-
addBlockade
public void addBlockade(ICity city, IBlockade blockade)
Add a blockade for the city.- Parameters:
city
- which is blockadedblockade
- the blockade metadata
-
getBlockade
public java.util.Optional<IBlockade> getBlockade(ICity city)
Retrieve the blockade for the city. If the city is not blockaded an Optional.empty is returned.- Parameters:
city
- for which the blockade objecd is to be retrieved.- Returns:
- Optional of the blockade metadata for the city. If there is no blockade, empty will be returned.
-
finishBlockade
public void finishBlockade(ICity city)
Finish the blockade.- Parameters:
city
- for which the blockade finished
-
-