COMP2396
|
A simple Tic Tac Toe game with GUI. More...
Classes | |
enum | END_GAME_STATUS |
enum | State |
Public Member Functions | |
void | go () |
Initialize the GUI. | |
void | go () |
Initialize the GUI and establish connection to server. | |
Static Public Member Functions | |
static void | main (String[] args) |
Main method to start the game. | |
static void | main (String[] args) |
Main method to start the game. | |
Private Member Functions | |
END_GAME_STATUS | checkWin () |
Check if the game is over by looking at the board[][] array. | |
void | closeConnection () |
Close the connection to the server. | |
void | enableGameBoard (boolean enable) |
Enable or disable the game board buttons based on the player's turn. | |
END_GAME_STATUS | endGameCheck () |
Responsible for popping a dialog box when the game ends. | |
String | getLocalTime () |
Get the current system time in 24 hour format. | |
String | getLocalTime () |
Get the current system time in 24-hour format without milliseconds. | |
void | initializeConnection () |
Establish connection to the server. | |
void | resetBoard () |
Reset the board to start a new game or due to opponent leaving. | |
void | submitName () |
Submit the player's name to the server. | |
void | updateBoard (char symbol, int row, int col) |
Update the board with the move. | |
A simple Tic Tac Toe game with GUI.
A two-player Tic Tac Toe game with GUI over the network.
COMP2396 Assignment 4
COMP2396 Assignment 5
|
inlineprivate |
Check if the game is over by looking at the board[][] array.
Definition at line 298 of file game.java.
References game.State.COMPUTER, game.END_GAME_STATUS.COMPUTER_WIN, game.END_GAME_STATUS.CONTINUE, game.END_GAME_STATUS.DRAW, game.State.PLAYER, and game.END_GAME_STATUS.PLAYER_WIN.
Referenced by endGameCheck().
|
inlineprivate |
Close the connection to the server.
Definition at line 529 of file game.java.
Referenced by go(), and initializeConnection().
|
inlineprivate |
Enable or disable the game board buttons based on the player's turn.
enable | True to enable, false to disable |
Definition at line 501 of file game.java.
Referenced by initializeConnection().
|
inlineprivate |
Responsible for popping a dialog box when the game ends.
Also updates the score display. Otherwise, return END_GAME_STATUS.CONTINUE.
Definition at line 263 of file game.java.
References checkWin(), game.END_GAME_STATUS.COMPUTER_WIN, game.END_GAME_STATUS.CONTINUE, game.END_GAME_STATUS.DRAW, game.State.EMPTY, and game.END_GAME_STATUS.PLAYER_WIN.
Referenced by go().
|
inlineprivate |
Get the current system time in 24 hour format.
Truncate the miliseconds precision.
Definition at line 251 of file game.java.
Referenced by go().
|
inlineprivate |
Get the current system time in 24-hour format without milliseconds.
Definition at line 522 of file game.java.
|
inline |
Initialize the GUI.
Set up the game board, player name input, and score display.
void |
Definition at line 43 of file game.java.
References game.State.COMPUTER, game.END_GAME_STATUS.CONTINUE, game.State.EMPTY, endGameCheck(), getLocalTime(), and game.State.PLAYER.
Referenced by main().
|
inline |
Initialize the GUI and establish connection to server.
Definition at line 54 of file game.java.
References closeConnection(), getLocalTime(), initializeConnection(), and submitName().
|
inlineprivate |
Establish connection to the server.
Definition at line 236 of file game.java.
References closeConnection(), enableGameBoard(), resetBoard(), and updateBoard().
Referenced by go().
|
inlinestatic |
Main method to start the game.
Initialize the game board and GUI.
args | Does nothing |
Definition at line 29 of file game.java.
References game.State.EMPTY, and go().
|
inlinestatic |
|
inlineprivate |
Reset the board to start a new game or due to opponent leaving.
Definition at line 465 of file game.java.
Referenced by initializeConnection().
|
inlineprivate |
Submit the player's name to the server.
Definition at line 435 of file game.java.
Referenced by go().
|
inlineprivate |
Update the board with the move.
symbol | The symbol to be placed on the board |
row | The row of the move |
col | The column of the move |
Definition at line 449 of file game.java.
Referenced by initializeConnection().