public void RestartGame() { if (!this._isTrash) { Interfaces._restartGame(this._gamePointer); } }
public int GetWinner() { if (this._isTrash) { return(0); } return(Interfaces._getWinner(this._gamePointer)); }
public void ReleaseGame() { if (!this._isTrash) { Interfaces._destroyGame(this._gamePointer); this._isTrash = true; } }
public static GameController NewGame() { GameController controller = new GameController(); controller._gamePointer = Interfaces._newGame(); controller._isTrash = false; return(controller); }
public bool PlayerMove(int r, int c) { if (this._isTrash) { return(false); } bool isOK = Interfaces._playerMove(this._gamePointer, r, c) == 1; this._winner = Interfaces._getWinner(this._gamePointer); return(isOK); }
public Point AIMove() { if (this._isTrash) { return(new Point(0, 0)); } Interfaces._aiMove(this._gamePointer); this._winner = Interfaces._getWinner(this._gamePointer); return(new Point( Interfaces._getLastRow(this._gamePointer), Interfaces._getLastCol(this._gamePointer))); }