public void DoNextStep(GameSnapshotForNextPlayer snapshot) { try { log("is next in line to choose colour"); callback.DoNextStep(snapshot); } catch (Exception ex) { logError("sending NextPlayerSnapshot", ex); } }
public void DoNextStep(GameSnapshotForNextPlayer snapshot) { lock (syncObject) { if (game != null) { var viewModel = snapshot.ToViewModel(); var availableCells = snapshot.AvailableCells?.Select(coord => coord.ToViewModel()).ToList(); Application.Current.Dispatcher.InvokeAsync(() => game.DoNextStep(viewModel, availableCells)); } } }
public void DoNextStep(GameSnapshotForNextPlayer snapshot) { writeStandings(snapshot.Players, player => player.Points); if (snapshot.AvailableCells == null) { Console.WriteLine("No available cells to select..."); } else { var avaliableColours = snapshot.Map .Where(cell => snapshot.AvailableCells.Any(coord => coord.X == cell.Coord.X && coord.Y == cell.Coord.Y)) .Select(cell => cell.Colour) .Distinct(); Console.WriteLine($"Available colours: {string.Join(" ", avaliableColours)}"); } }