Skip to content

Instantly share code, notes, and snippets.

@JamesBender
Last active June 22, 2016 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesBender/379b21c0e5980cc268a1a4ee748ded95 to your computer and use it in GitHub Desktop.
Save JamesBender/379b21c0e5980cc268a1a4ee748ded95 to your computer and use it in GitHub Desktop.
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