ArmedCards.BusinessLogic.DomainServices.Game.Join.Execute C# (CSharp) Метод

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

Join a game
public Execute ( Entities game, Entities user, String passphrase, Entities playerType ) : Entities.JoinResponse
game Entities
user Entities The current user
passphrase String The passphrase for the game
playerType Entities Type of player joining
Результат Entities.JoinResponse
        public Entities.JoinResponse Execute(Entities.Game game, Entities.User user, String passphrase, Entities.Enums.GamePlayerType playerType)
        {
            Entities.JoinResponse response = new Entities.JoinResponse();

            Boolean wasWaiting = game.IsWaiting();

            if (game.GameOver.HasValue)
            {
                response.Result = Entities.Enums.Game.JoinResponseCode.GameOver;
            }
            else
            {
                if (playerType == Entities.Enums.GamePlayerType.Spectator)
                {
                    AsSpectator(game, user, passphrase, response);
                }
                else
                {
                    AsPlayer(game, user, passphrase, response, wasWaiting);
                }
            }

            return response;
        }