java.lang.Object
polimi.ingsw.am21.codex.model.Player.Player
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
drawCard
(PlayableCard card) void
evaluate
(ObjectiveCard objectiveCard) Uses the PlayerBoard to evaluate the points of the objective card passed as argument adds the point to the player score.void
Evaluates the player secret objective, called by the Game class when Game oversgetBoard()
int
getToken()
placeCard
(int cardIndex, CardSideType side, Position position) Asks the PlayerBoard to position the card and then evaluates itvoid
-
Method Details
-
getConnectionID
-
getNickname
- Returns:
- player's nickname
-
getBoard
- Returns:
- player's board
-
getToken
- Returns:
- player's token
-
getPoints
public int getPoints()- Returns:
- player's points
-
drawCard
- Parameters:
card
- drawn from the GameBoard which is added to the players hand
-
placeCard
public PlayableCard placeCard(int cardIndex, CardSideType side, Position position) throws InvalidActionException, AlreadyPlacedCardGameException Asks the PlayerBoard to position the card and then evaluates it- Parameters:
cardIndex
- of the card chosen from the player's hand,side
- of the card chosen to be placed on the PlayerBoardposition
- of the PlayerBoard in which the card will be placed by the PlayerBoard- Throws:
IndexOutOfBoundsException
- if the index provided exceeds the playerIllegalCardSideChoiceException
- if the side chosen is not placeable because of the side placing conditionIllegalPlacingPositionException
- if the position provided is either unreachable, occupied or forbiddenInvalidActionException
AlreadyPlacedCardGameException
-
evaluate
Uses the PlayerBoard to evaluate the points of the objective card passed as argument adds the point to the player score.- Parameters:
objectiveCard
- to be evaluated at the end of the game
-
evaluateSecretObjective
public void evaluateSecretObjective()Evaluates the player secret objective, called by the Game class when Game overs -
getCardPlaced
-
resetCardPlaced
public void resetCardPlaced()
-