public BetGameEditorControl(BetGameCommand command)
        {
            InitializeComponent();

            this.existingCommand = command;
            this.viewModel       = new BetGameEditorControlViewModel(this.existingCommand);
        }
Пример #2
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            RoleRequirementViewModel starterRequirement = new RoleRequirementViewModel(this.WhoCanStart);
            GameCommandBase          newCommand         = new BetGameCommand(name, triggers, requirements, this.MinimumParticipants, this.TimeLimit, starterRequirement,
                                                                             this.Options.Select(o => o.GetGameOutcome()), this.StartedCommand, this.UserJoinedCommand, this.BetsClosedCommand,
                                                                             new GameOutcome("Failure", 0, new Dictionary <UserRoleEnum, int>()
            {
                { UserRoleEnum.User, 0 }, { UserRoleEnum.Subscriber, 0 }, { UserRoleEnum.Mod, 0 }
            }, this.UserFailCommand),
                                                                             this.GameCompleteCommand, this.NotEnoughPlayersCommand);

            this.SaveGameCommand(newCommand, this.existingCommand);
        }
        public BetGameEditorControlViewModel(BetGameCommand command)
            : this()
        {
            this.existingCommand = command;

            this.WhoCanStart         = this.existingCommand.GameStarterRequirement.MixerRole;
            this.MinimumParticipants = this.existingCommand.MinimumParticipants;
            this.TimeLimit           = this.existingCommand.TimeLimit;

            this.StartedCommand    = this.existingCommand.StartedCommand;
            this.UserJoinedCommand = this.existingCommand.UserJoinCommand;

            this.NotEnoughPlayersCommand = this.existingCommand.NotEnoughPlayersCommand;
            this.BetsClosedCommand       = this.existingCommand.BetsClosedCommand;
            this.UserFailCommand         = this.existingCommand.UserFailOutcome.Command;
            this.GameCompleteCommand     = this.existingCommand.GameCompleteCommand;

            foreach (GameOutcome outcome in this.existingCommand.BetOptions)
            {
                this.Options.Add(new BetOutcome(outcome));
            }
        }