Skip to content

Instantly share code, notes, and snippets.

@JamesBender
Last active April 8, 2016 17:15
Show Gist options
  • Save JamesBender/97ec1fd1a4936bff89262ed6c9a938b4 to your computer and use it in GitHub Desktop.
Save JamesBender/97ec1fd1a4936bff89262ed6c9a938b4 to your computer and use it in GitHub Desktop.
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