java.lang.Object
it.polimi.ingsw.am13.client.gamestate.FieldState
- All Implemented Interfaces:
Serializable
Representation of one player's field.
It stores information about the placed cards, and the available coordinates where to place new cards
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<Coordinates> List of available coordinates where to place other cards during the gameprivate final Map
<Coordinates, CardSidePlayableIF> Map between coordinates and cards placed on them Once placed, a card cannot be removed -
Constructor Summary
ConstructorsConstructorDescriptionFieldState
(FieldIF field) Creates a new representation of a player's field starting from the interface of that field itself -
Method Summary
Modifier and TypeMethodDescriptiongetCardSideAtCoord
(Coordinates coord) (package private) void
placeCardSideAtCoord
(Coordinates coord, CardSidePlayableIF cardSide) Sets the given coordinates with the given card side placed on them(package private) void
setAvailableCoords
(List<Coordinates> availableCoords) Sets the list of available coordinates where to place other cards during the game.
-
Field Details
-
field
Map between coordinates and cards placed on them Once placed, a card cannot be removed -
availableCoords
List of available coordinates where to place other cards during the game
-
-
Constructor Details
-
FieldState
Creates a new representation of a player's field starting from the interface of that field itself- Parameters:
field
- Field to build the representation of
-
-
Method Details
-
getPlacedCoords
- Returns:
- List of coordinates where there is a card placed. The list is ordered from the first placed coordinates to the latest ones
-
getCardSideAtCoord
- Parameters:
coord
- Coordinates of the placed card to retrieve- Returns:
- Card side of the card placed on the given coordinates, or null if no card is placed on those coordinates
-
placeCardSideAtCoord
Sets the given coordinates with the given card side placed on them- Parameters:
coord
- Coordinates where the card is placedcardSide
- Card side placed on the given coordinates
-
getAvailableCoords
- Returns:
- List of available coordinates where to place other cards during the game
-
setAvailableCoords
Sets the list of available coordinates where to place other cards during the game. (It does not create another list)- Parameters:
availableCoords
- New list of available coordinates where to place other cards during the game
-
getResourcesInField
-