private void checkForNewSpells() { bool foundOne = false; foreach (PlayerClass cl in prntForm.playerClassesList) { foreach (Spell sp in prntForm.spellsList) { foreach (SpellAllowed sa in cl.spellsAllowed) { if (sa.tag == sp.tag) { foundOne = true; break; } } if (!foundOne) { SpellAllowed newSA = new SpellAllowed(); newSA.name = sp.name; newSA.tag = sp.tag; cl.spellsAllowed.Add(newSA); } else { foundOne = false; } } } }
private void fillAllowedSpellList() { foreach (Spell sp in prntForm.spellsList) { SpellAllowed newSA = new SpellAllowed(); newSA.name = sp.name; newSA.tag = sp.tag; prntForm.playerClassesList[selectedLbxIndex].spellsAllowed.Add(newSA); } }
public PlayerClass DeepCopy() { PlayerClass other = (PlayerClass)this.MemberwiseClone(); other.itemsAllowed = new List <ItemRefs>(); foreach (ItemRefs s in this.itemsAllowed) { other.itemsAllowed.Add(s.DeepCopy()); } other.traitsAllowed = new SortableBindingList <TraitAllowed>(); foreach (TraitAllowed s in this.traitsAllowed) { TraitAllowed sa = s.DeepCopy(); other.traitsAllowed.Add(sa); } other.spellsAllowed = new SortableBindingList <SpellAllowed>(); foreach (SpellAllowed s in this.spellsAllowed) { SpellAllowed sa = s.DeepCopy(); other.spellsAllowed.Add(sa); } return(other); }
private void checkForNewSpells() { bool foundOne = false; foreach (PlayerClass cl in prntForm.playerClassesList) { foreach (Spell sp in prntForm.spellsList) { foreach (SpellAllowed sa in cl.spellsAllowed) { if (sa.tag == sp.tag) { foundOne = true; break; } } if (!foundOne) { SpellAllowed newSA = new SpellAllowed(); newSA.name = sp.name; newSA.tag = sp.tag; cl.spellsAllowed.Add(newSA); } else { foundOne = false; } } } }
private void fillAllowedSpellList() { foreach (Spell sp in prntForm.spellsList) { SpellAllowed newSA = new SpellAllowed(); newSA.name = sp.name; newSA.tag = sp.tag; prntForm.playerClassesList[selectedLbxIndex].spellsAllowed.Add(newSA); } }
public SpellAllowed DeepCopy() { SpellAllowed other = (SpellAllowed)this.MemberwiseClone(); return(other); }