Exemple #1
0
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            VolcanoGameCommandModel gCommand = (VolcanoGameCommandModel)command;

            gCommand.StatusArgument           = this.StatusArgument;
            gCommand.Stage1DepositCommand     = this.Stage1DepositCommand;
            gCommand.Stage1StatusCommand      = this.Stage1StatusCommand;
            gCommand.Stage2MinimumAmount      = this.Stage2MinimumAmount;
            gCommand.Stage2DepositCommand     = this.Stage2DepositCommand;
            gCommand.Stage2StatusCommand      = this.Stage2StatusCommand;
            gCommand.Stage3MinimumAmount      = this.Stage3MinimumAmount;
            gCommand.Stage3DepositCommand     = this.Stage3DepositCommand;
            gCommand.Stage3StatusCommand      = this.Stage3StatusCommand;
            gCommand.PayoutProbability        = this.PayoutProbability;
            gCommand.PayoutMinimumPercentage  = this.PayoutMinimumPercentage;
            gCommand.PayoutMaximumPercentage  = this.PayoutMaximumPercentage;
            gCommand.PayoutCommand            = this.PayoutCommand;
            gCommand.CollectArgument          = this.CollectArgument;
            gCommand.CollectTimeLimit         = this.CollectTimeLimit;
            gCommand.CollectMinimumPercentage = this.CollectMinimumPercentage;
            gCommand.CollectMaximumPercentage = this.CollectMaximumPercentage;
            gCommand.CollectCommand           = this.CollectCommand;
        }
 protected async Task RunSubCommand(CommandModelBase command, CommandParametersModel parameters)
 {
     await ChannelSession.Services.Command.Queue(new CommandInstanceModel(command, parameters)
     {
         ShowInUI = false
     });
 }
Exemple #3
0
        private void RefreshUI()
        {
            if (this.EditButton != null && this.HideEditingButton)
            {
                this.EditButton.Visibility = Visibility.Collapsed;
            }

            if (this.DeleteButton != null && this.HideDeleteButton)
            {
                this.DeleteButton.Visibility = Visibility.Collapsed;
            }

            if (this.EnableDisableToggleSwitch != null && this.HideEnableDisableToggle)
            {
                this.EnableDisableToggleSwitch.Visibility = Visibility.Collapsed;
            }

            CommandModelBase command = this.GetCommandFromCommandButtons();

            if (command != null)
            {
                if (this.EnableDisableToggleSwitch != null)
                {
                    this.EnableDisableToggleSwitch.IsChecked = command.IsEnabled;
                }
            }
        }
        protected override async Task PerformInternal(CommandParametersModel parameters)
        {
            List <bool> results = new List <bool>();

            foreach (ConditionalClauseModel clause in this.Clauses)
            {
                results.Add(await this.Check(clause, parameters));
            }

            bool finalResult = false;

            if (this.Operator == ConditionalOperatorTypeEnum.And)
            {
                finalResult = results.All(r => r);
            }
            else if (this.Operator == ConditionalOperatorTypeEnum.Or)
            {
                finalResult = results.Any(r => r);
            }
            else if (this.Operator == ConditionalOperatorTypeEnum.ExclusiveOr)
            {
                finalResult = results.Count(r => r) == 1;
            }

            if (finalResult)
            {
                await CommandModelBase.RunActions(this.Actions, parameters);
            }
        }
 private async Task RunCommand(CommandModelBase command)
 {
     if (command != null)
     {
         await command.Perform();
     }
 }
Exemple #6
0
        public CommunityCommandUploadWindow(CommandModelBase command)
        {
            InitializeComponent();

            this.command = command;

            this.Initialize(this.StatusBar);
        }
 private void Window_CommandSaved(object sender, CommandModelBase command)
 {
     if (this.lastSelectedProductCommand != null)
     {
         this.lastSelectedProductCommand.Command = command;
     }
     this.lastSelectedProductCommand = null;
 }
        public CommandImporterDialogControl(CommandModelBase command)
        {
            InitializeComponent();

            this.command = command;

            this.DataContext = this.ViewModel = new CommandImporterDialogControlViewModel();
        }
Exemple #9
0
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            EventCommandModel eCommand = (EventCommandModel)command;

            eCommand.EventType = this.EventType;
        }
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            SlotMachineGameCommandModel gCommand = (SlotMachineGameCommandModel)command;

            gCommand.Symbols        = new List <string>(this.SymbolsList);
            gCommand.FailureCommand = this.FailureCommand;
            gCommand.Outcomes       = new List <SlotMachineGameOutcomeModel>(this.Outcomes.Select(o => ((SlotMachineGameOutcomeViewModel)o).GetModel()));
        }
 public async Task ImportActionsFromCommand(CommandModelBase command)
 {
     if (command != null)
     {
         foreach (ActionModelBase action in command.Actions)
         {
             await this.ActionEditorList.AddAction(action);
         }
     }
 }
Exemple #12
0
        protected override async Task OnVisibilityChanged()
        {
            // TODO: Fix this to not use GetEnumNames, that doens't support localization.
            this.CommandTypeComboBox.ItemsSource = EnumHelper.GetEnumNames(CommandModelBase.GetSelectableCommandTypes());
            this.KeyComboBox.ItemsSource         = EnumHelper.GetEnumNames <InputKeyEnum>().OrderBy(s => s);

            this.RefreshList();

            await this.InitializeInternal();
        }
 public void AddCommand(CommandModelBase command)
 {
     if (this.commandLookup.ContainsKey(command.ID))
     {
         this.RemoveCommand(this.commandLookup[command.ID]);
     }
     this.commandLookup[command.ID] = command;
     this.Commands.SortedInsert(command);
     this.NotifyPropertyChanged("HasCommands");
 }
        public override async Task UpdateExistingCommand(CommandModelBase command)
        {
            await base.UpdateExistingCommand(command);

            StealGameCommandModel gCommand = (StealGameCommandModel)command;

            gCommand.PlayerSelectionType = this.GetSelectionType();
            gCommand.SuccessfulOutcome   = this.SuccessfulOutcome.GetModel();
            gCommand.FailedCommand       = this.FailedCommand;
        }