public ConnectFour(ConnectFourConfiguration config) { _config = config; _game = new ConnectFourGame(config); _players = new List <ConnectFourPlayer>(); }
public ActionResult Restart(string playerId) { if (_config.CreatorId != playerId) { return(new ActionResult(false, "You are not the host")); } _game.ClearBoard(); _gameOver = false; _started = true; _currentPlayerIndex = 0; // un-resign resigned players _players.ForEach(p => p.Resigned = false); _game = new ConnectFourGame(_config); return(new ActionResult(true)); }