Player
Date: 2017-05-13

game_backend

## Class Player

- java.lang.Object
- - game_backend.Player

-     public class Player
      extends java.lang.Object

  Represents a player that can interact with a game of cards
  Author:
    João Vieira, Guilherme Reis, Catarina Santos

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `credit`
    `private Hand` | `hand`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Player(int credit)` Constructor of Player that receives as argument the number of credits that player will have at his disposal

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `bet(int credits)` Retrieves credits
    `int` | `getCredit()` Shows the credit of the player in a given moment
    `void` | `receiveCards(Card[] cards)` Save cards passed by argument in player's hand
    `Card[]` | `retrieveCards(int[] cards)` Retrieves cards from the player's hand that are at the positions indicated
    `Card[]` | `showHand()` Shows the references of the cards present in player's hand
    `void` | `win(int credit)` Adds a prize to player's account

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### credit

          private int credit

    - #### hand

          private Hand hand

  - ### Constructor Detail

    - #### Player

          public Player(int credit)

      Constructor of Player that receives as argument the number of credits that player will have at his disposal
      Parameters:
        `credit` - Number of credits that the player has at the beginning

  - ### Method Detail

    - #### getCredit

          public int getCredit()

      Shows the credit of the player in a given moment
      Returns:
        int Credit of the player in a given moment

    - #### retrieveCards

          public Card[] retrieveCards(int[] cards)

      Retrieves cards from the player's hand that are at the positions indicated
      Parameters:
        `cards` - positions of the cards that are to be retrieved
      Returns:
        Card[] cards retrieved

    - #### receiveCards

          public void receiveCards(Card[] cards)

      Save cards passed by argument in player's hand
      Parameters:
        `cards` - Cards to be saved

    - #### bet

          public int bet(int credits)

      Retrieves credits
      Parameters:
        `credits` - from player's account
      Returns:
        int Credits retrieved

    - #### win

          public void win(int credit)

      Adds a prize to player's account
      Parameters:
        `credit` - Amount to add to player's account

    - #### showHand

          public Card[] showHand()

      Shows the references of the cards present in player's hand
      Returns:
        Card[] References of the cards in player's hand