コード例 #1
0
ファイル: SpellEditor.cs プロジェクト: grannypron/IB2Toolset
        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;
                    }
                }
            }
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
ファイル: PlayerClass.cs プロジェクト: grannypron/IB2Toolset
        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);
        }
コード例 #4
0
 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;
             }
         }
     }
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
ファイル: PlayerClass.cs プロジェクト: grannypron/IB2Toolset
        public SpellAllowed DeepCopy()
        {
            SpellAllowed other = (SpellAllowed)this.MemberwiseClone();

            return(other);
        }