Skip to content

Instantly share code, notes, and snippets.

@JamesBender
Created May 18, 2016 16:39
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/25408b7b8d493fa4ec7d5aa03f2c85ff to your computer and use it in GitHub Desktop.
Save JamesBender/25408b7b8d493fa4ec7d5aa03f2c85ff to your computer and use it in GitHub Desktop.
Game Engine for TDD
using System;
using GameNetworkInterfaces;
namespace TicTacToe.Core
{
public class GameEngine
{
private ICommonGameNetworkControl _network;
public GameEngine(ICommonGameNetworkControl network)
{
_network = network;
}
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)
{
return _network.Login(userName, password);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment