示例#1
0
 public GameQueueAction(GameQueueActionType gameQueueType, RoleRequirementViewModel roleRequirement = null, string targetUsername = null)
     : this()
 {
     this.GameQueueType   = gameQueueType;
     this.RoleRequirement = roleRequirement;
     this.TargetUsername  = targetUsername;
 }
示例#2
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            RoleRequirementViewModel starterRequirement = new RoleRequirementViewModel(this.WhoCanStart);
            GameCommandBase          newCommand         = new BidGameCommand(name, triggers, requirements, this.MinimumParticipants, this.TimeLimit, starterRequirement,
                                                                             this.StartedCommand, this.UserJoinedCommand, this.GameCompleteCommand, this.NotEnoughPlayersCommand);

            this.SaveGameCommand(newCommand, this.existingCommand);
        }
示例#3
0
 public void SetRoleRequirement(RoleRequirementViewModel role)
 {
     if (role != null)
     {
         this.tempRole = role;
         this.RoleComboBox.ItemsSource  = RoleRequirementViewModel.AdvancedUserRoleAllowedValues;
         this.RoleComboBox.SelectedItem = role.RoleNameString;
     }
 }
示例#4
0
        public override void SaveGameCommand(string name, IEnumerable <string> triggers, RequirementViewModel requirements)
        {
            RoleRequirementViewModel starterRequirement = new RoleRequirementViewModel(this.WhoCanStart);
            GameCommandBase          newCommand         = new BidGameCommand(name, triggers, requirements, this.MinimumParticipants, this.TimeLimit, starterRequirement,
                                                                             this.StartedCommand, this.UserJoinedCommand, this.GameCompleteCommand, this.NotEnoughPlayersCommand);

            if (this.existingCommand != null)
            {
                ChannelSession.Settings.GameCommands.Remove(this.existingCommand);
                newCommand.ID = this.existingCommand.ID;
            }
            ChannelSession.Settings.GameCommands.Add(newCommand);
        }
示例#5
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);
        }
示例#6
0
        public async Task SelectFirstType(RoleRequirementViewModel requirement)
        {
            UserViewModel user = this.queue.FirstOrDefault(u => requirement.DoesMeetRequirement(u));

            if (user != null)
            {
                await this.SelectFirst();
            }
            else
            {
                this.queue.Remove(user);
                await ChannelSession.Settings.GameQueueUserSelectedCommand.Perform(user);
            }
            GlobalEvents.GameQueueUpdated();
        }
        public override void SaveGameCommand()
        {
            int.TryParse(this.MinimumParticipantsTextBox.Text, out int minimumParticipants);
            int.TryParse(this.TimeLimitTextBox.Text, out int timeLimit);
            RoleRequirementViewModel starterRequirement = new RoleRequirementViewModel((string)this.GameStartRoleComboBox.SelectedItem);

            GameCommandBase newCommand = new BidGameCommand(this.CommandDetailsControl.GameName, this.CommandDetailsControl.ChatTriggers,
                                                            this.CommandDetailsControl.GetRequirements(), minimumParticipants, timeLimit, starterRequirement, this.startedCommand, this.userJoinCommand, this.gameCompleteCommand);

            if (this.existingCommand != null)
            {
                ChannelSession.Settings.GameCommands.Remove(this.existingCommand);
                newCommand.ID = this.existingCommand.ID;
            }
            ChannelSession.Settings.GameCommands.Add(newCommand);
        }
示例#8
0
        public void SetRoleRequirement(RoleRequirementViewModel role)
        {
            if (role != null)
            {
                this.tempRole = role;
                this.RoleComboBox.ItemsSource  = MixItUp.Base.ViewModel.Requirements.RoleRequirementViewModel.SelectableUserRoles();
                this.RoleComboBox.SelectedItem = role.MixerRole;

                if (role.SubscriberTier > 0)
                {
                    this.SubTierComboBox.SelectedIndex = role.SubscriberTier - 1;
                }
                else
                {
                    this.SubTierComboBox.SelectedIndex = 0;
                }
            }
        }
示例#9
0
 public GameQueueAction(GameQueueActionType gameQueueType, RoleRequirementViewModel roleRequirement = null)
     : this()
 {
     this.GameQueueType = gameQueueType;
     this.RoleRequirement = roleRequirement;
 }