Ejemplo n.º 1
0
        public async Task <bool> CheckDeallerFirstCard(CheckDeallerFirstCardGameView checkDeallerFirstCardGameView)
        {
            Hand hand = await _handRepository.GetHandWithCardsByRoundAndPlayerId(checkDeallerFirstCardGameView.RoundId, checkDeallerFirstCardGameView.PlayerId);

            if (hand == null)
            {
                var stringBuilder = new StringBuilder();

                stringBuilder.AppendLine(string.Format("RoundId: {0}", checkDeallerFirstCardGameView.RoundId));
                stringBuilder.AppendLine(string.Format("PlayerId: {0}", checkDeallerFirstCardGameView.PlayerId));
                stringBuilder.AppendLine(string.Format("Message: {0}", SolutionConstants.BUSINESS_LOGIC_GET_ITEM_EXCEPTION_MESSAGE));

                string message = stringBuilder.ToString();

                throw new BusinessLogicGetItemException(message);
            }

            Card card = hand.HandCards.Select(item => item.Card).First();

            bool result = card.Face == CardFace.Ace;

            return(result);
        }
Ejemplo n.º 2
0
        public async Task <bool> CheckDeallerFirstCard([FromBody] CheckDeallerFirstCardGameView checkDeallerFirstCardGameView)
        {
            bool IsAce = await _gameLogicService.CheckDeallerFirstCard(checkDeallerFirstCardGameView);

            return(IsAce);
        }