package com.skraylabs.poker.model;

/**
 * The state of a Texas Hold 'Em Poker game.
 */
public class GameState {

  /**
   * The "board". Community cards.
   */
  private Board board;

  /**
   * Pocket cards. Player cards. There is a maximum of 10 players.
   */
  private Pocket[] pockets = new Pocket[10];

  /**
   * Default constructor.
   */
  GameState() {
  }

  /**
   * Accessor: get a copy of the board cards.
   *
   * @return community cards
   */
  public Board getBoard() {
    Board result = null;
    if (this.board != null) {
      result = new Board(this.board);
    }
    return result;
  }

  /**
   * Modifier: set the board cards.
   *
   * @param board community cards to set
   */
  void setBoard(Board board) {
    this.board = board;
  }

  /**
   * Accessor: get pocket cards.
   *
   * @return player cards
   */
  public Pocket[] getPockets() {
    return pockets;
  }

  /**
   * Modifier: set Pocket cards for a specified player.
   *
   * @param playerIndex a value in range [0, 9]. Specify player for which to assign pocket cards.
   * @param pocket Pocket value to assign.
   */
  void setPocketForPlayer(int playerIndex, Pocket pocket) {
    // TODO: implement me!
  }
}

@@ -108,16 +108,54 @@
 tate %7B%0A%0A
+  static final int MAX_PLAYERS = 10;%0A%0A
   /**%0A  
@@ -336,18 +336,27 @@
  Pocket%5B
-10
+MAX_PLAYERS
 %5D;%0A%0A  /*
@@ -1223,30 +1223,282 @@
     
-// TODO: implement me!
+if (playerIndex %3C 0 %7C%7C MAX_PLAYERS %3C= playerIndex) %7B%0A      throw new IllegalArgumentException(%0A          String.format(%22Unexpected value %5B%25d%5D for 'playerIndex'. Must be in range %5B0, %25d%5D%22,%0A              playerIndex, MAX_PLAYERS - 1));%0A    %7D%0A    pockets%5BplayerIndex%5D = pocket;
 %0A  %7D

implement setPocketForPlayer().