private Combination DecideCombination(IGame game) { Combination result = null; foreach (Combination c in game.Scoreboard.Combinations) { if (!c.UsedByPlayer(game.CurrentPlayer)) { if (result == null) { result = c; } else if (result.CalculateScore(game.Dices) < c.CalculateScore(game.Dices)) { result = c; } } } return(result); }
public void SetCombinationForPlayer(IPlayer player, Combination c, IDices dices) { if (c.UsedByPlayer(player)) { throw new ArgumentException("Combination already set!"); } c.ApplyCombinationForPlayer(player, dices); Console.WriteLine("Player " + player.Name + " applied combination " + c.Name + ", with a score of " + c.CalculateScore(dices) + "."); OnCombinationApplied(c); }