ArmedCards.BusinessLogic.AppServices.GameRound.Complete.Execute C# (CSharp) Метод

Execute() публичный Метод

Complete the current round
public Execute ( Int32 gameID, List cardIDs, Int32 userId ) : void
gameID System.Int32 The ID of the game that contains the round
cardIDs List The IDs of the winning cards
userId System.Int32 The user Id trying to complete the round
Результат void
        public void Execute(Int32 gameID, List<Int32> cardIDs, Int32 userId)
        {
            Entities.ActionResponses.RoundComplete response = _completeGameRound.Execute(gameID, cardIDs, userId);

            if (response.CompletedRound != null && response.Game != null)
            {
                _sendMessage.SendWinnerSelected(response.Game, response.CompletedRound, true);

                DateTime playedLast = DateTime.UtcNow;
                DateTime? gameOver = null;

                if(response.Game.HasWinner())
                {
                    gameOver = playedLast;
                }

                _updateGame.Execute(gameID, playedLast, gameOver);
            }
        }