Last active
April 8, 2016 17:15
-
-
Save JamesBender/97ec1fd1a4936bff89262ed6c9a938b4 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 System; | |
using TicTacToe.Core.ExternalSystem; | |
namespace TicTacToe.Core | |
{ | |
public class GameEngine | |
{ | |
private ICommonGameNetworkControl _networkInterface; | |
public GameEngine(ICommonGameNetworkControl networkInterface) | |
{ | |
_networkInterface = networkInterface; | |
} | |
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)) | |
{ | |
throw new ArgumentException(); | |
} | |
return _networkInterface.Login(userName, password); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment