C# Класс TicTacToeAppWarp.MainPage

Наследование: BasePage
Показать файл Открыть проект

Private Properties

Свойство Тип Описание
ClearStatusText void
DidSomeoneWin string
GameOver void
InitializeBoard void
LockGameboard void
NewGame void
PiecesAvailable bool
Play void
ShowWinningLine void
UnLockGameboard void
UpdateStatus void
UpdateUiFromMove void
_initBoard void
_updateStatus void
appbarEndGame_Click void
appbarHideDiag_Click void
appbarNewGame_Click void
tb_Tap void

Открытые методы

Метод Описание
MainPage ( ) : System
showResult ( String result ) : void

Защищенные методы

Метод Описание
OnNavigatedFrom ( System e ) : void
OnNavigatingFrom ( System e ) : void

Приватные методы

Метод Описание
ClearStatusText ( ) : void
DidSomeoneWin ( ) : string

Hard-coded game logic to keep things simple. There are 8 possible ways someone can get a winning line. I check for each one here.

GameOver ( ) : void

Lock the gameboard when the game is over

InitializeBoard ( ) : void

Clear all board pieces and reset their text color. Also resets the mapping of gamepiece to value

LockGameboard ( ) : void
NewGame ( ) : void

Refreshes the game board and informs the user what gamepiece they are playing

PiecesAvailable ( ) : bool

Check to see if there are any squares on the board still in play

Play ( TextBlock tbTapped, TicTacToeAppWarp.MoveMessage msg ) : void

Play the selected piece.

ShowWinningLine ( TextBlock w1, TextBlock w2, TextBlock w3 ) : void

Add a little bling to the gameboard by showing the winning line in a different color

UnLockGameboard ( ) : void
UpdateStatus ( string status ) : void

Helper method to write a simple status update to a TextBlock on the page. Uses the Dispatcher object if currently not on UI Thread.

UpdateUiFromMove ( TicTacToeAppWarp.MoveMessage msg ) : void
_initBoard ( ) : void

Clear all text on the board, reset font color and clear out internal gamepiece map

_updateStatus ( string status ) : void
appbarEndGame_Click ( object sender, EventArgs e ) : void
appbarHideDiag_Click ( object sender, EventArgs e ) : void
appbarNewGame_Click ( object sender, EventArgs e ) : void
tb_Tap ( object sender, GestureEventArgs e ) : void

Event handler for the Tap event on each gamepiece

Описание методов

MainPage() публичный Метод

public MainPage ( ) : System
Результат System

OnNavigatedFrom() защищенный Метод

protected OnNavigatedFrom ( System e ) : void
e System
Результат void

OnNavigatingFrom() защищенный Метод

protected OnNavigatingFrom ( System e ) : void
e System
Результат void

showResult() публичный Метод

public showResult ( String result ) : void
result String
Результат void