public void Execute() { log.Debug("Execute"); var deck = InitDeck(); log.Debug("Got deck"); var host = new Host(LocalEndpoint); var passwords = ParseClients(); var players = shufflingAlgorithm.Shuffle(host.AcceptPlayers(passwords)); log.Debug("Got players"); var game = new Game(deckFactory, players); var gameResults = game.Start(); log.Debug("Game finished"); try { PersistResults(gameResults); } catch (Exception e) { log.Error(e); } }
public void Execute() { var deck = InitDeck(); var host = new Host(LocalEndpoint); var players = ParseClients().Select(kvp => host.Accept(kvp.Key, kvp.Value)).ToList(); var game = InitGame(players, deck); game.Start(); }