Exemple #1
0
        public void Init()
        {
            this.listSwitch = ListSwitch.None;
            this.Heroes     = new RecordCollection();

            DHLOOKUP.RefreshTaverns();
        }
Exemple #2
0
        internal void SetListState(ListSwitch ls)
        {
            if (listSwitch == ls)
            {
                return;
            }
            else
            {
                listSwitch = ls;
            }

            foreach (Control c in contentPanel.Controls)
            {
                if (c is Button)
                {
                    if (String.Compare((c as Button).Name, ls.ToString(), true) == 0)
                    {
                        (c as Button).BackColor = Color.Gray;
                    }
                    else
                    {
                        (c as Button).BackColor = Color.Black;
                    }
                }
            }

            InitListByState(ls);
        }
Exemple #3
0
        internal void SetListState(Button switchButton)
        {
            foreach (Control c in contentPanel.Controls)
            {
                if (c is Button)
                {
                    if (switchButton == (c as Button))
                    {
                        (c as Button).BackColor = Color.Gray;
                    }
                    else
                    {
                        (c as Button).BackColor = Color.Black;
                    }
                }
            }

            ListSwitch ls = (ListSwitch)Enum.Parse(typeof(ListSwitch), switchButton.Name, true);

            if (listSwitch == ls)
            {
                return;
            }
            else
            {
                listSwitch = ls;
            }

            InitListByState(ls);
        }
Exemple #4
0
        internal void InitListByState(ListSwitch ls)
        {
            if (DHMpqDatabase.UnitSlkDatabase.Count == 0)
            {
                return;
            }

            HabPropertiesCollection hpcShortHeroes = new HabPropertiesCollection();

            switch (ls)
            {
            case ListSwitch.All:
                foreach (unit tavern in DHLOOKUP.taverns)
                {
                    foreach (string unitID in tavern.sellunits)
                    {
                        HabProperties hps = DHLOOKUP.hpcUnitProfiles[unitID];
                        hpcShortHeroes.Add(hps);
                    }
                }
                break;

            case ListSwitch.Sentinel:
                foreach (unit tavern in DHLOOKUP.taverns)
                {
                    if (tavern.y < 0)
                    {
                        foreach (string unitID in tavern.sellunits)
                        {
                            HabProperties hps = DHLOOKUP.hpcUnitProfiles[unitID];
                            hpcShortHeroes.Add(hps);
                        }
                    }
                }
                break;

            case ListSwitch.Scourge:
                foreach (unit tavern in DHLOOKUP.taverns)
                {
                    if (tavern.y > 0)
                    {
                        foreach (string unitID in tavern.sellunits)
                        {
                            HabProperties hps = DHLOOKUP.hpcUnitProfiles[unitID];
                            hpcShortHeroes.Add(hps);
                        }
                    }
                }
                break;
            }

            InitList(hpcShortHeroes);
        }