Esempio n. 1
0
 public void RemoveLevel(Level l)
 {
     _list.Remove(l);
 }
Esempio n. 2
0
 public int AddLevel(Level t)
 {
     return _list.Add( t );
 }
Esempio n. 3
0
        private void SwitchLevels(Level cur, Level prev)
        {
            Level saved = (Level)cur.Clone();

            cur.Update(prev.TabId, prev.TalentId, prev.Rank);
            RefreshLevelList();
            prev.Update(saved.TabId, saved.TalentId, saved.Rank);
            RefreshLevelList();
        }
Esempio n. 4
0
 public Talents(string pattern, string url, string descr, 
     Level[] levels)
     : this()
 {
     Pattern = pattern;
     URL = url;
     Description = descr;
     LevelList = levels;
 }
Esempio n. 5
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            int num = 10;
            int tab = 1;
            int talent = 1;
            int rank = 1;

            // Find last item
            if ((CurTalents != null) && (CurTalents.Levels.Count > 0))
            {
                Level last = (Level)CurTalents.Levels[CurTalents.Levels.Count - 1];

                num = last.Num + 1;
                tab = last.TabId;
                talent = last.TalentId;

                if (last.Rank < numRank.Maximum)
                    rank = last.Rank + 1;
                else
                    talent++;
            }

            Level l  = new Level(num , tab, talent, rank);

            bool is_new = (CurTalents == null);
            if (is_new)
            {
                // Don't forget add .xml extension for new file
                CurTalents = new Talents(cbTalentTemplates.Text + ".xml",
                                        tbTalentURL.Text, tbDescription.Text);
                BindLevels();
            }

            CurTalents.AddLevel(l);

            RefreshLevelList();
            lbLevelList.SelectedIndex = lbLevelList.Items.Count - 1;

            RegisterChange();
        }