Exemplo n.º 1
0
        public HeroType GetEnumType(string name)
        {
            HeroType type = new HeroType(HeroTypes.Enum);

            if (this.DefinitionsByName[HeroDefinition.Types.Enumeration].ContainsKey(name))
            {
                HeroEnumDef def = this.DefinitionsByName[(HeroDefinition.Types) 2][name] as HeroEnumDef;
                type.Id = new DefinitionId(def.Id);
            }
            return(type);
        }
Exemplo n.º 2
0
 public int GetEnumValue(string enumType, string enumValue)
 {
     if (this.DefinitionsByName[HeroDefinition.Types.Enumeration].ContainsKey(enumType))
     {
         HeroEnumDef def = this.DefinitionsByName[(HeroDefinition.Types) 2][enumType] as HeroEnumDef;
         for (int i = 0; i < def.Values.Count; i++)
         {
             if (def.Values[i] == enumValue)
             {
                 return(i + 1);
             }
         }
     }
     return(0);
 }
Exemplo n.º 3
0
        public int GetEnumValue(string enumType, string enumValue)
        {
            int num = 0;

            if (this.DefinitionsByName[HeroDefinition.Types.Enumeration].ContainsKey(enumType))
            {
                HeroEnumDef heroEnumDef = this.DefinitionsByName[HeroDefinition.Types.Enumeration][enumType] as HeroEnumDef;
                for (int index = 0; index < heroEnumDef.Values.Count; ++index)
                {
                    if (heroEnumDef.Values[index] == enumValue)
                    {
                        num = index + 1;
                        break;
                    }
                }
            }
            return(num);
        }