public RollState(IGameTurn turn, IDice dice) { if (turn == null) throw new ArgumentNullException(nameof(turn)); if (dice == null) throw new ArgumentNullException(nameof(dice)); this.turn = turn; this.dice = dice; }
public MoveRobberState(IGameTurn turn, IRobber robber) { if (turn == null) throw new ArgumentNullException(nameof(turn)); if (robber == null) throw new ArgumentNullException(nameof(robber)); this.turn = turn; this.robber = robber; }
public RobberStealState(IGameTurn turn, IBoard board) { if (turn == null) throw new ArgumentNullException(nameof(turn)); if (board == null) throw new ArgumentNullException(nameof(board)); if (board.Robber == null) throw new ArgumentNullException(nameof(board.Robber)); this.turn = turn; //CvB todo maybe cleaner to get those values from a class that handles the actual stealing? var stealablePlayers = board.GetPlayers(board.Robber.CurrentTile); if (!stealablePlayers.Any() || stealablePlayers.All(p => p == turn.Player)) turn.NextFlowState(); }
public RobberDiscardState(IGameTurn turn, IEnumerable<IPlayer> players) { if (turn == null) throw new ArgumentNullException(nameof(turn)); if (players == null) throw new ArgumentNullException(nameof(players)); this.turn = turn; this.players = players; desiredInventorySizes = new Dictionary<IPlayer, int>(); foreach (var player in players) { if (player.Inventory.Count() > 7) { double inveotryCount = player.Inventory.Count(); int desired = Convert.ToInt32(Math.Round(inveotryCount / 2, MidpointRounding.AwayFromZero)); desiredInventorySizes.Add(player, desired); } } CheckStateChange(); }
public MonopolyState(IGameTurn turn) { if (turn == null) throw new ArgumentNullException(nameof(turn)); this.turn = turn; }
public RoadBuildingState(IGameTurn turn) { if (turn == null) throw new ArgumentNullException(nameof(turn)); this.turn = turn; }
public YearOfPlentyState(IGameTurn turn) { if (turn == null) throw new ArgumentNullException(nameof(turn)); this.turn = turn; }