Question: What does the final, completed code of this class look like? It is used to compile ConnectFourCLI.java and ConnectFourTester.java package cs 1 3 0 2

What does the final, completed code of this class look like? It is used to compile ConnectFourCLI.java and ConnectFourTester.java
package cs1302.game;
import cs1302.gameutil.GamePhase;
import cs1302.gameutil.Token;
import cs1302.gameutil.TokenGrid;
/**
*{@code ConnectFour} represents a two-player connection game involving a two-dimensional grid of
*{@linkplain cs1302.gameutil.Token tokens}. When a {@code ConnectFour} game object is
* constructed, several instance variables representing the game's state are initialized and
* subsequently accessible, either directly or indirectly, via "getter" methods. Over time, the
* values assigned to these instance variables should change so that they always reflect the
* latest information about the state of the game. Most of these changes are described in the
* project's
* functional requirements.
*/
public class ConnectFour {
//----------------------------------------------------------------------------------------------
// INSTANCE VARIABLES: You should NOT modify the instance variable declarations below.
// You should also NOT add any additional instance variables. Static variables should
// also NOT be added.
//----------------------------------------------------------------------------------------------
private int rows; // number of grid rows
private int cols; // number of grid columns
private Token[][] grid; //2D array of tokens in the grid
private Token[] player; //1D array of player tokens (length 2)
private int numDropped; // number of tokens dropped so far
private int lastDropRow; // row index of the most recent drop
private int lastDropCol; // column index of the most recent drop
private GamePhase phase; // current game phase
//----------------------------------------------------------------------------------------------
// CONSTRUCTOR
//----------------------------------------------------------------------------------------------
/**
* Constructs a {@link cs1302.game.ConnectFour} game with a grid that has {@code rows}-many
* rows and {@code cols}-many columns. All of the game's instance variables are expected to
* be initialized by this constructor as described in the project's
* functional
* requirements.
*
* @param rows the number of grid rows
* @param cols the number of grid columns
* @throws IllegalArgumentException if the value supplied for {@code rows} or {@code cols} is
* not supported. The following values are supported: {@code 6<= rows <=9} and
*{@code 7<= cols <=9}.
*/
public ConnectFour(int rows, int cols){
//
// replace the entire contents of this constructor with your implementation
//
//throw new UnsupportedOperationException("constructor: not yet implemented.");
}// ConnectFour
//----------------------------------------------------------------------------------------------
// INSTANCE METHODS
//----------------------------------------------------------------------------------------------
/**
* Return the number of rows in the game's grid.
*
* @return the number of rows
*/
public int getRows(){
//
// replace the entire contents of this method with your implementation
//
throw new UnsupportedOperationException("getRows: not yet implemented.");
}// getRows
/**
* Return the number of columns in the game's grid.
*
* @return the number of columns
*/
public int getCols(){
//
// replace the entire contents of this method with your implementation
//
throw new UnsupportedOperationException("getCols: not yet implemented.");
}// getCols
/**
* Return whether {@code row} and {@code col} specify a location inside this game's grid.
*
* @param row the position's row index
* @param col the positions's column index
* @return {@code true} if {@code row} and {@code col} specify a location inside this game's
* grid and {@code false} otherwise
*/
public boolean isInBounds(int row, int col){
//
// replace the entire contents of this method with your implementation
//
throw new UnsupportedOperationException("isInBounds: not yet implemented.");
}// isInBounds
/**
* Return the grid {@linkplain cs1302.gameutil.Token token} located at the specified position
* or {@code null} if no token has been dropped into that position.
*
* @param row the token's row index
* @param col the token's column index
* @return the grid token lo

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!