コード例 #1
0
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            RouletteGameCommandModel gCommand = (RouletteGameCommandModel)command;

            gCommand.MinimumParticipants     = this.MinimumParticipants;
            gCommand.TimeLimit               = this.TimeLimit;
            gCommand.BetType                 = this.SelectedBetType;
            gCommand.BetOptions              = this.GetBetOptions();
            gCommand.StartedCommand          = this.StartedCommand;
            gCommand.UserJoinCommand         = this.UserJoinCommand;
            gCommand.NotEnoughPlayersCommand = this.NotEnoughPlayersCommand;
            gCommand.UserSuccessOutcome      = this.UserSuccessOutcome.GetModel();
            gCommand.UserFailureCommand      = this.UserFailureCommand;
            gCommand.GameCompleteCommand     = this.GameCompleteCommand;
        }
コード例 #2
0
 public RouletteGameCommandEditorWindowViewModel(RouletteGameCommandModel command)
     : base(command)
 {
     this.MinimumParticipants = command.MinimumParticipants;
     this.TimeLimit           = command.TimeLimit;
     this.SelectedBetType     = command.BetType;
     if (this.SelectedBetType == RouletteGameCommandBetType.NumberRange)
     {
         this.BetOptionsNumberRangeLow  = int.Parse(command.BetOptions.ElementAt(0));
         this.BetOptionsNumberRangeHigh = int.Parse(command.BetOptions.ElementAt(1));
     }
     else if (this.SelectedBetType == RouletteGameCommandBetType.Custom)
     {
         this.BetOptionsCustom = string.Join(" ", command.BetOptions);
     }
     this.StartedCommand          = command.StartedCommand;
     this.UserJoinCommand         = command.UserJoinCommand;
     this.NotEnoughPlayersCommand = command.NotEnoughPlayersCommand;
     this.UserSuccessOutcome      = new GameOutcomeViewModel(command.UserSuccessOutcome);
     this.UserFailureCommand      = command.UserFailureCommand;
     this.GameCompleteCommand     = command.GameCompleteCommand;
 }