package com.skraylabs.poker.model;

/**
 * The "board" is the set of 5 community cards shared by all players in a game Texas Hold 'Em
 * Poker.
 */
public class Board {
  /**
   * First of three cards dealt in the second round (the "flop").
   */
  public Card flopCard1;
  /**
   * Second of three cards dealt in the second round (the "flop").
   */
  public Card flopCard2;
  /**
   * Third of three cards dealt in the second round (the "flop").
   */
  public Card flopCard3;
  /**
   * Card dealt in the third round (the "turn").
   */
  public Card turnCard;
  /**
   * Card dealt in the fourth and final round (the "river").
   */
  public Card riverCard;

  /**
   * Default constructor.
   */
  public Board() {
    this(null, null, null);
  }

  /**
   * Initializing constructor.
   *
   * @param flopCard1
   * @param flopCard2
   * @param flopCard3
   */
  public Board(Card flopCard1, Card flopCard2, Card flopCard3) {
    this(flopCard1, flopCard2, flopCard3, null);
  }

  /**
   * Initializing constructor.
   *
   * @param flopCard1
   * @param flopCard2
   * @param flopCard3
   * @param turnCard
   */
  public Board(Card flopCard1, Card flopCard2, Card flopCard3, Card turnCard) {
    this(flopCard1, flopCard2, flopCard3, turnCard, null);
  }

  /**
   * Initializing constructor.
   *
   * @param flopCard1
   * @param flopCard2
   * @param flopCard3
   * @param turnCard
   * @param riverCard
   */
  public Board(Card flopCard1, Card flopCard2, Card flopCard3, Card turnCard, Card riverCard) {
    this.flopCard1 = flopCard1;
    this.flopCard2 = flopCard2;
    this.flopCard3 = flopCard3;
    this.turnCard = turnCard;
    this.riverCard = riverCard;
  }

  @Override
  public boolean equals(Object o) {
    // TODO: implement me!
    boolean result = false;
    return result;
  }
} // end of class Board
@@ -1730,58 +1730,1164 @@
     
-// TODO: implement me!%0A    boolean result = false;
+boolean result = false;%0A    if (o instanceof Board) %7B%0A      Board thatBoard = (Board) o;%0A      result = true;%0A      for (int i = 0 ; i %3C 5; ++i) %7B%0A        Card thisCard = null;%0A        Card thatCard = null;%0A        switch (i) %7B%0A          case 0:%0A            thisCard = this.flopCard1;%0A            thatCard = thatBoard.flopCard1;%0A            break;%0A          case 1:%0A            thisCard = this.flopCard2;%0A            thatCard = thatBoard.flopCard2;%0A            break;%0A          case 2:%0A            thisCard = this.flopCard3;%0A            thatCard = thatBoard.flopCard3;%0A            break;%0A          case 3:%0A            thisCard = this.turnCard;%0A            thatCard = thatBoard.turnCard;%0A            break;%0A          case 4:%0A            thisCard = this.riverCard;%0A            thatCard = thatBoard.riverCard;%0A            break;%0A        %7D%0A        if (thisCard != null) %7B%0A          if (thisCard.equals(thatCard)) %7B%0A            continue;%0A          %7D else %7B%0A            result = false;%0A            break;%0A          %7D%0A        %7D else if (thatCard == null) %7B%0A          continue;%0A        %7D else %7B%0A          result = false;%0A          continue;%0A        %7D%0A      %7D%0A    %7D
 %0A   

implement equals() method.