package cpsc2150.extendedConnectX.models;

/**
 * Class that represents an entire game board for the ExtendedConnectX game.
 * <p>This class includes methods to place tokens, check token locations,
 * and determine whether or not the game has been won or is over.</p>
 *
 * @author Owen Sullivan
 * @version 1.0
 *
 * @invariant board[][] = ' ' OR board[][] = 'X' OR board[][] = 'O'
 */
public class GameBoard {

    char[][] board;

    /**
     * Constructor for GameBoard that takes no parameters and
     * initializes all indexes of board to ' '.
     *
     * @pre
     *      [board[][] is uninitialized]
     *
     * @post
     *      board[][] = ' '
     */
    GameBoard() {



    }

    /**
     * Function that returns true if the column can accept another
     * token; false otherwise.
     *
     * @param c Column to be checked
     * @return Whether the column can accept another token
     *
     * @pre
     *      c {@code <=} 6
     *
     * @post
     *      checkIfFree = true iff (board[c][8] = 'X' OR board[c][8] = 'O') AND board[][] = #board[][]
     *      checkIfFree = false iff (board[c][8] = ' ') AND board[][] = #board[][]
     */
    public boolean checkIfFree(int c) {



    }

    /**
     * Function that places the character p in column c. The token will be placed in
     * the lowest available row in column c.
     *
     * @param p Character to be placed (representing player token)
     * @param c Column to place token in
     *
     * @pre
     *      (p = 'X' OR p = 'O') AND c {@code <=} 6
     *
     * @post
     *      board[c][] = 'X' OR board[c][] = 'O'
     */
    public void placeToken(char p, int c) {



    }

    /**
     * This function will check to see if the last token placed in
     * column c resulted in the player winning the game. If so it will return
     * true, otherwise false.
     *
     * @param c Column number to be checked
     * @return Whether placing a token results in a player winning the game
     *
     * @pre
     *      c {@code <=} 6
     *
     * @post
     *      checkForWin = true iff (checkTie = false AND (checkHorizWin = true OR checkVertWin = true OR checkDiagWin = true) AND board[][] = #board[][]
     *      checkForWin = false iff (checkTie = true OR (checkHorizWin = false AND checkVertWin = false AND checkDiagWin = false) AND board[][] = #board[][]
     */
    public boolean checkForWin(int c) {



    }

    /**
     * This function will check to see if the game has resulted in a
     * tie. A game is tied if there are no free board positions remaining.
     * It will return true if the game is tied and false otherwise.
     *
     * @return Whether the game has resulted in a tie
     *
     * @post
     *      checkTie = true iff ([all board positions are either 'X' or 'O'] AND (checkHorizWin = false AND checkVertWin = false AND checkDiagWin = false)) AND board[][] = #board[][]
     *      checkTie = false iff ([not all board positions are either 'X' or 'O']) AND board[][] = #board[][]
     */
    public boolean checkTie() {



    }

    /**
     * This function checks to see if the last token placed (which was placed in
     * position pos by player p) resulted in 5 in a row horizontally. Returns
     * true if it does, otherwise false.
     *
     * @param pos BoardPosition pair of row and column
     * @param p Player to check with
     * @return Whether the last token placed resulted in 5 in a row horizontally
     *
     * @pre
     *      (0 {@code >=} pos.row {@code <=} 8 AND 0 {@code >=} pos.column {@code <=} 6) AND
     *      (p = 'X' OR p = 'O')
     *
     * @post
     *      checkHorizWin = true iff ([5 horizontal positions are p]) AND board[][] = #board[][]
     *      checkHorizWin = true iff ([5 horizontal positions are not p]) AND board[][] = #board[][]
     */
    public boolean checkHorizWin(BoardPosition pos, char p) {



    }

    /**
     * This function checks to see if the last token placed (which was placed in
     * position pos by player p) resulted in 5 in a row vertically. Returns
     * true if it does, otherwise false.
     *
     * @param pos BoardPosition pair of row and column
     * @param p Player to check with
     * @return Whether the last token placed resulted in 5 in a row vertically
     *
     * @pre
     *      (0 { @ code > = } pos.row { @ code < = } 8 AND 0 { @ code > = } pos.column { @ code < = } 6) AND
     *      (p = 'X' OR p = 'O')
     *
     * @post
     *      checkVertWin = true iff ([5 vertical positions are p]) AND board[][] = #board[][]
     *      checkVertWin = true iff ([5 vertical positions are not p]) AND board[][] = #board[][]
     */
    public boolean checkVertWin(BoardPosition pos, char p) {



    }

    /**
     * This function checks to see if the last token placed (which was placed in
     * position pos by player p) resulted in 5 in a row diagonally. Returns
     * true if it does, otherwise false.
     *
     * @param pos BoardPosition pair of row and column
     * @param p Player to check with
     * @return Whether the last token placed resulted in 5 in a row diagonally
     *
     * @pre
     *      (0 { @ code > = } pos.row { @ code < = } 8 AND 0 { @ code > = } pos.column { @ code < = } 6) AND
     *      (p = 'X' OR p = 'O')
     *
     * @post
     *      checkVertWin = true iff ([5 diagonal positions are p]) AND board[][] = #board[][]
     *      checkVertWin = true iff ([5 diagonal positions are not p]) AND board[][] = #board[][]
     */
    public boolean checkDiagWin(BoardPosition pos, char p) {



    }

    /**
     * Function that returns what is in the GameBoard at position pos.
     * If no marker is there, it returns a blank space char.
     *
     * @param pos BoardPosition pair of row and column
     * @return Character representing player token or space
     *
     * @pre
     *      (0 { @ code > = } pos.row { @ code < = } 8 AND 0 { @ code > = } pos.column { @ code < = } 6)
     *
     * @post
     *      whatsAtPos = board[pos.row][pos.column] AND board[][] = #board[][]
     */
    public char whatsAtPos(BoardPosition pos) {



    }

    /**
     * This function returns true if the player is at pos; otherwise, it returns
     * false.
     *
     * @param pos BoardPosition pair of row and column
     * @param player Player to check with
     * @return Whether a player's token is at a position
     *
     * @pre
     *      (0 { @ code > = } pos.row { @ code < = } 8 AND 0 { @ code > = } pos.column { @ code < = } 6) AND
     *      (player = 'X' OR player = 'O')
     *
     * @post
     *      isPlayerAtPos = true iff (board[pos.row][pos.col] = player) AND board[][] = #board[][]
     *      isPlayerAtPos = false iff (board[pos.row][pos.col] != player) AND board[][] = #board[][]
     */
    public boolean isPlayerAtPos(BoardPosition pos, char player) {



    }

    /**
     * Overloaded toString method for GameBoard.
     * <p><b>NOTE:</b> The string will change depending on the values of the GameBoard
     * object that calls the toString method, and thus the post-condition for this method
     * is partially informal.</p>
     *
     * @return A string that shows the entire game board
     *
     * @post
     *      [toString shows the entire game board] AND board[][] = #board[][]
     */
    @Override
    public String toString() {



    }

}
