public IGameSession Create(IPlayer playerOne, IPlayer playerTwo, IExpectedGame expectedGame) { if (expectedGame is ExpectedTicTacToe) { int size = ((ExpectedTicTacToe)expectedGame).Size; return(new TicTacToeGameSession(playerOne, playerTwo, size)); } if (expectedGame is ExpectedChess) { return(new ChessGameSession(playerOne, playerTwo, chessGameFactory)); } throw new NotImplementedException(); }
public void SetAsSearchingForGame(IExpectedGame expectedGame) { ExpectedGame = expectedGame; State = PlayerState.SearchingForGame; }