java.lang.Object
polimi.ingsw.am21.codex.model.Player.PlayerBoard
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerBoard
(List<PlayableCard> hand, PlayableCard starterCard, ObjectiveCard objectiveCard) -
Method Summary
Modifier and TypeMethodDescriptiongetHand()
void
placeCard
(PlayableCard playedCard, CardSideType playedSideType, Position position) Places a card on the playerBoard,
-
Constructor Details
-
PlayerBoard
public PlayerBoard(List<PlayableCard> hand, PlayableCard starterCard, ObjectiveCard objectiveCard) throws IllegalCardSideChoiceException, IllegalPlacingPositionException - Parameters:
hand
- the player's cards drawn from the GameBoard (2 resources and 1 GoldCard)starterCard
- drawn from the PlayerBoardobjectiveCard
- chosen by the client controller (physical player)- Throws:
IllegalCardSideChoiceException
IllegalPlacingPositionException
-
-
Method Details
-
getObjectiveCard
- Returns:
- the player's secret objective
-
getHand
- Returns:
- the player's hand
-
getPlaceableCardSides
- Returns:
- a list of sides that are both playable and placeable
-
placeCard
public void placeCard(PlayableCard playedCard, CardSideType playedSideType, Position position) throws IllegalPlacingPositionException, IllegalCardSideChoiceException Places a card on the playerBoard,- Parameters:
playedCard
- chosen from the player's hand, the card will be evaluated after placementplayedSideType
- of the card chosen to be placed on the PlayerBoardposition
- of the PlayerBoard in which the card will be placed by the PlayerBoard- Throws:
IllegalPlacingPositionException
- if the provided position is either not reachable, forbidden or occupiedIllegalCardSideChoiceException
- if the side chosen is not placeable because of card placing conditions.
-
getObjects
-
getResources
-
getPlayedCards
-
getAvailableSpots
-
getForbiddenSpots
-