Game logic for tic tac toe game
More...
|
| bool | SetMarker () |
| | Places marker of the current player at current cursor position More...
|
| |
| void | MoveCursor (int x, int y) |
| | Moves the cursor by increment of 1 in x / y direction More...
|
| |
| bool | GetWinner () |
| | Checks if a player has won and returns that player More...
|
| |
| void | CheckGameStatus () |
| | Checks if the game is won by either player and sets the winner property if winner is found. More...
|
| |
Game logic for tic tac toe game
Definition at line 8 of file Game.cs.
◆ CheckGameStatus()
| void TickTackToe.Game.CheckGameStatus |
( |
| ) |
|
Checks if the game is won by either player and sets the winner property if winner is found.
Definition at line 80 of file Game.cs.
◆ GetWinner()
| bool TickTackToe.Game.GetWinner |
( |
| ) |
|
Checks if a player has won and returns that player
- Returns
- The winning player. Has no value when no player has won.
Definition at line 70 of file Game.cs.
◆ MoveCursor()
| void TickTackToe.Game.MoveCursor |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
Moves the cursor by increment of 1 in x / y direction
- Parameters
-
| x | Move the x position |
| y | Move the y position |
Does nothing if x or y are more than 1 / -1 or would move the cursor outside of the field
Definition at line 54 of file Game.cs.
◆ SetMarker()
| bool TickTackToe.Game.SetMarker |
( |
| ) |
|
Places marker of the current player at current cursor position
- Returns
- false if already a marker at cursor position or game is won, true otherwise
Definition at line 36 of file Game.cs.
◆ currentPlayer
| bool TickTackToe.Game.currentPlayer = false |
◆ winnables
| int [][] TickTackToe.Game.winnables |
Initial value:=
{
new int[]{0,1,2},
new int[]{3,4,5},
new int[]{6,7,8},
new int[]{0,3,6},
new int[]{1,4,7},
new int[]{2,5,8},
new int[]{0,4,8},
new int[]{2,4,6}
}
Definition at line 19 of file Game.cs.
◆ cursor
| int [] TickTackToe.Game.cursor = new bool?[3, 3] |
|
get |
◆ field
| bool [,] TickTackToe.Game.field = { 'X', 'O', ' ' } |
|
get |
◆ isGameRunning
| bool TickTackToe.Game.isGameRunning = null |
|
get |
◆ playerSymbols
| char [] TickTackToe.Game.playerSymbols |
|
get |
◆ winner
| bool TickTackToe.Game.winner |
|
get |
The documentation for this class was generated from the following file:
- C:/Users/lasse/Documents/Visual Studio 2015/Projects/TickTackToe/TickTackToe/Game.cs