Exemple #1
0
        public AutoBuildForm(Mode mode)
        {
            InitializeComponent();

            fData = new AutoBuildData();
            fMode = mode;

            init_options();

            switch (fMode)
            {
            case Mode.Encounter:
            {
                TemplateBox.Items.Add(RANDOM);
                List <string> names = EncounterBuilder.FindTemplateNames();
                foreach (string name in names)
                {
                    TemplateBox.Items.Add(name);
                }
                TemplateBox.SelectedItem = (fData.Type != "") ? fData.Type : RANDOM;

                DiffBox.Items.Add(Difficulty.Random);
                DiffBox.Items.Add(Difficulty.Easy);
                DiffBox.Items.Add(Difficulty.Moderate);
                DiffBox.Items.Add(Difficulty.Hard);
                DiffBox.SelectedItem = fData.Difficulty;

                LevelBox.Value = fData.Level;
                update_cats();
            }
            break;

            case Mode.Delve:
            {
                TemplateLbl.Enabled = false;
                TemplateBox.Enabled = false;
                TemplateBox.Items.Add("(not applicable)");
                TemplateBox.SelectedIndex = 0;

                DiffLbl.Enabled = false;
                DiffBox.Enabled = false;
                DiffBox.Items.Add("(not applicable)");
                DiffBox.SelectedIndex = 0;

                LevelBox.Value = fData.Level;
                update_cats();
            }
            break;

            case Mode.Deck:
            {
                TemplateLbl.Enabled = false;
                TemplateBox.Enabled = false;
                TemplateBox.Items.Add("(not applicable)");
                TemplateBox.SelectedIndex = 0;

                DiffLbl.Enabled = false;
                DiffBox.Enabled = false;
                DiffBox.Items.Add("(not applicable)");
                DiffBox.SelectedIndex = 0;

                LevelBox.Value = fData.Level;
                update_cats();
            }
            break;
            }
        }
        public AutoBuildForm(AutoBuildForm.Mode mode)
        {
            this.InitializeComponent();
            this.fData = new AutoBuildData();
            this.fMode = mode;
            this.init_options();
            switch (this.fMode)
            {
            case AutoBuildForm.Mode.Encounter:
            {
                this.TemplateBox.Items.Add("Random");
                foreach (string str in EncounterBuilder.FindTemplateNames())
                {
                    this.TemplateBox.Items.Add(str);
                }
                this.TemplateBox.SelectedItem = (this.fData.Type != "" ? this.fData.Type : "Random");
                this.DiffBox.Items.Add(Difficulty.Random);
                this.DiffBox.Items.Add(Difficulty.Easy);
                this.DiffBox.Items.Add(Difficulty.Moderate);
                this.DiffBox.Items.Add(Difficulty.Hard);
                this.DiffBox.SelectedItem = this.fData.Difficulty;
                this.LevelBox.Value       = this.fData.Level;
                this.update_cats();
                return;
            }

            case AutoBuildForm.Mode.Delve:
            {
                this.TemplateLbl.Enabled = false;
                this.TemplateBox.Enabled = false;
                this.TemplateBox.Items.Add("(not applicable)");
                this.TemplateBox.SelectedIndex = 0;
                this.DiffLbl.Enabled           = false;
                this.DiffBox.Enabled           = false;
                this.DiffBox.Items.Add("(not applicable)");
                this.DiffBox.SelectedIndex = 0;
                this.LevelBox.Value        = this.fData.Level;
                this.update_cats();
                return;
            }

            case AutoBuildForm.Mode.Deck:
            {
                this.TemplateLbl.Enabled = false;
                this.TemplateBox.Enabled = false;
                this.TemplateBox.Items.Add("(not applicable)");
                this.TemplateBox.SelectedIndex = 0;
                this.DiffLbl.Enabled           = false;
                this.DiffBox.Enabled           = false;
                this.DiffBox.Items.Add("(not applicable)");
                this.DiffBox.SelectedIndex = 0;
                this.LevelBox.Value        = this.fData.Level;
                this.update_cats();
                return;
            }

            default:
            {
                return;
            }
            }
        }