public bool MoveToNextAction() { var currentPlayerWithAction = RoundPlayers.SingleOrDefault(a => a.HasAction); if (currentPlayerWithAction == null) { return(false); } currentPlayerWithAction.HasAction = false; var nextPlayerWithAction = RoundPlayers .Where(a => a.Player.Position > currentPlayerWithAction.Player.Position) .OrderBy(a => a.Player.Position) .FirstOrDefault(); if (nextPlayerWithAction == null) { return(false); } nextPlayerWithAction.HasAction = true; return(true); }
public BlackjackGameRoundPlayer GetRoundPlayer(BlackjackGamePlayer player) { return(RoundPlayers.SingleOrDefault(a => a.Player.Id == player.Id)); }