コード例 #1
0
        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);
        }
コード例 #2
0
 public BlackjackGameRoundPlayer GetRoundPlayer(BlackjackGamePlayer player)
 {
     return(RoundPlayers.SingleOrDefault(a => a.Player.Id == player.Id));
 }