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); }
public async Task <bool> CheckDeallerFirstCard([FromBody] CheckDeallerFirstCardGameView checkDeallerFirstCardGameView) { bool IsAce = await _gameLogicService.CheckDeallerFirstCard(checkDeallerFirstCardGameView); return(IsAce); }