Пример #1
0
  /**
   * Returns the Card at the given coordinates.
   *
   * @param x the column position of the Card on the game board.
   * @param y the row position of the Card on the game board.
   * @return the Card at the given coordinates x and y.
   */
  public Card getCardFromBoard(Natural x, Natural y) {
    // SET index to x * 3 + y
    int index = x.intValue() * kInlaySize + y.intValue();

    // RETURN Card from cardList at returnIndex
    return cardList.get(index);
  }
Пример #2
0
 /**
  * Returns the Card from the in-lay at the given index.
  *
  * @param index : The index in the in-lay.
  * @return The Card from the in-lay at the given index.
  */
 public Card getInlayCard(Natural index) {
   // RETURN Card from inlayList at position of index
   return inlayList.get(index.intValue());
 }