Last active
June 22, 2016 18:27
-
-
Save JamesBender/379b21c0e5980cc268a1a4ee748ded95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GameNetworkInterfaces; | |
using System; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine | |
{ | |
private ICommonGameNetworkControl _gameNetworkControl; | |
public GameEngine(ICommonGameNetworkControl gameNetworkControl) | |
{ | |
_gameNetworkControl = gameNetworkControl; | |
} | |
public string GetWinner(string[,] board) | |
{ | |
if (board[0, 0] == "X" && board[0, 1] == "X" && board[0, 2] == "X") | |
{ | |
return "X"; | |
} | |
return " "; | |
} | |
public Guid Login(string username, string password) | |
{ | |
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) | |
{ | |
return Guid.Empty; | |
} | |
return _gameNetworkControl.Login(username, password); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment