- All Known Implementing Classes:
Field
public interface FieldIF
Interface representing a player's field.
It exposes methods to build the actual field and query some possibly useful information for the game about the field.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the List of coordinates in which new cards can be placed.getCardSideAtCoord
(Coordinates coord) Retrieves the card side of the placed card in the Field at given coordinates.boolean
isCoordPlaced
(Coordinates coord) Checks if the coordinated passed as parameters has a card placed on it
-
Method Details
-
getCoordinatesPlaced
List<Coordinates> getCoordinatesPlaced()- Returns:
- A list of all coordinated where a card has been already positioned. The list is empty if no cards has been placed yet. For how the game works, the coordinate (0,0), if the list is not empty, must be present. The coordinates are listed in the same order they where placed, from the oldest to the latest one
-
isCoordPlaced
Checks if the coordinated passed as parameters has a card placed on it- Parameters:
coord
- Coordinates to be checked if a card is on it- Returns:
- True if a card is on the indicated coordinated, false otherwise
-
getCardSideAtCoord
Retrieves the card side of the placed card in the Field at given coordinates.- Parameters:
coord
- Coordinates of the card.- Returns:
- If present, the card side at given coordinates. If not present, null.
-
getResourcesInField
- Returns:
- A map associating each possible game resources to how many are visible in the present field.
-
getAvailableCoords
List<Coordinates> getAvailableCoords()Retrieves the List of coordinates in which new cards can be placed. It returns all and only the coordinates for which cardIsPlaceableAtCoord() returns true for the actual Field situation.- Returns:
- A list of coordinates in which a card can be placed.
-