private static void LocalPlayerVersusLocalPlayer() { var setup = new SpaceBeansGameSetup(); IEnumerable<ConsolePlayer> players = Enumerable.Range(1, 2).Select(i => new LocalPlayer(i)).ToArray(); foreach(var trader in players.Select(p => p.Trader)) { setup.AddTrader(trader); } var game = new SpaceBeansGame(setup); game.Start(); new GamePlayer(game, players.Append(new LocalSystem())).PlayGame(); }
public void GameStarted() { waitForReadyToStart.WaitOne(); game = new SpaceBeansGame(setup); game.AddResultSource(this); game.DecisionNeeded += (sender, args) => { args.Decision.Decided += (decision, result) => { if (!DecisionResolved(result)) { proxy.Channel.ResolveDecision(result); } }; }; game.Start(); waitForGameStart.Set(); }
public GamePlayer(SpaceBeansGame game, IEnumerable<ConsolePlayer> players) { this.game = game; this.players = players.ToArray(); }