コード例 #1
0
ファイル: HeroClassDef.cs プロジェクト: exodus444/swtoremu2
 public HeroFieldDef GetField(string name)
 {
     foreach (DefinitionId definitionId in this.Fields)
     {
         HeroFieldDef heroFieldDef = definitionId.Definition as HeroFieldDef;
         if (heroFieldDef != null && heroFieldDef.Name == name)
         {
             return(heroFieldDef);
         }
     }
     foreach (DefinitionId definitionId in this.ParentClasses)
     {
         HeroClassDef heroClassDef = definitionId.Definition as HeroClassDef;
         if (heroClassDef != null)
         {
             HeroFieldDef field = heroClassDef.GetField(name);
             if (field != null)
             {
                 return(field);
             }
         }
     }
     return((HeroFieldDef)null);
 }
コード例 #2
0
 public HeroFieldDef GetField(string name)
 {
     foreach (DefinitionId id in this.Fields)
     {
         HeroFieldDef definition = id.Definition as HeroFieldDef;
         if ((definition != null) && (definition.Name == name))
         {
             return(definition);
         }
     }
     foreach (DefinitionId id2 in this.ParentClasses)
     {
         HeroClassDef def2 = id2.Definition as HeroClassDef;
         if (def2 != null)
         {
             HeroFieldDef field = def2.GetField(name);
             if (field != null)
             {
                 return(field);
             }
         }
     }
     return(null);
 }