public BetGameCommandEditorWindowViewModel(BetGameCommandModel command) : base(command) { this.SelectedStarterRole = command.StarterRole; this.MinimumParticipants = command.MinimumParticipants; this.TimeLimit = command.TimeLimit; this.StartedCommand = command.StartedCommand; this.UserJoinCommand = command.UserJoinCommand; this.NotEnoughPlayersCommand = command.NotEnoughPlayersCommand; this.BetsClosedCommand = command.BetsClosedCommand; this.GameCompleteCommand = command.GameCompleteCommand; this.Outcomes.AddRange(command.BetOptions.Select(o => new GameOutcomeViewModel(o))); }
public override async Task UpdateExistingCommand(CommandModelBase command) { await base.UpdateExistingCommand(command); BetGameCommandModel gCommand = (BetGameCommandModel)command; gCommand.StarterRole = this.SelectedStarterRole; gCommand.MinimumParticipants = this.MinimumParticipants; gCommand.TimeLimit = this.timeLimit; gCommand.BetOptions = new List <GameOutcomeModel>(this.Outcomes.Select(o => o.GetModel())); gCommand.StartedCommand = this.StartedCommand; gCommand.UserJoinCommand = this.UserJoinCommand; gCommand.NotEnoughPlayersCommand = this.NotEnoughPlayersCommand; gCommand.BetsClosedCommand = this.BetsClosedCommand; gCommand.GameCompleteCommand = this.GameCompleteCommand; }