public void RemoveLevel(Level l) { _list.Remove(l); }
public int AddLevel(Level t) { return _list.Add( t ); }
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(); }
public Talents(string pattern, string url, string descr, Level[] levels) : this() { Pattern = pattern; URL = url; Description = descr; LevelList = levels; }
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(); }