public BidGameEditorControl(BidGameCommand command)
        {
            InitializeComponent();

            this.existingCommand = command;
            this.viewModel       = new BidGameEditorControlViewModel(this.existingCommand);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public BidGameEditorControlViewModel(BidGameCommand command)
        {
            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.GameCompleteCommand     = this.existingCommand.GameCompleteCommand;
        }
        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);
        }
 public BidGameEditorControl(BidGameCommand command)
     : this()
 {
     this.existingCommand = command;
 }