public static PBELocalizedString GetItemName(PBEItem item)
 {
     if (!Enum.IsDefined(typeof(PBEItem), item))
     {
         throw new ArgumentOutOfRangeException(nameof(item));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "ItemNames", (ushort)item))[0]));
 }
 public static PBELocalizedString GetTypeName(PBEType type)
 {
     if (type >= PBEType.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(type));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "TypeNames", (byte)type))[0]));
 }
 public static PBELocalizedString GetMoveName(PBEMove move)
 {
     if (move >= PBEMove.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(move));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "MoveNames", (ushort)move))[0]));
 }
 public static PBELocalizedString GetGenderName(PBEGender gender)
 {
     if (gender >= PBEGender.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(gender));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "GenderNames", (byte)gender))[0]));
 }
 public static PBELocalizedString GetSpeciesName(PBESpecies species)
 {
     if (species <= 0 || species >= PBESpecies.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(species));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "SpeciesNames", (ushort)species))[0]));
 }
 public static PBELocalizedString GetStatName(PBEStat stat)
 {
     if (!Enum.IsDefined(typeof(PBEStat), stat))
     {
         throw new ArgumentOutOfRangeException(nameof(stat));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "StatNames", (byte)stat))[0]));
 }
 public static PBELocalizedString GetAbilityName(PBEAbility ability)
 {
     if (ability >= PBEAbility.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(ability));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryId, "AbilityNames", (byte)ability))[0]));
 }
Exemplo n.º 8
0
 public static PBELocalizedString GetNatureName(PBENature nature)
 {
     if (nature >= PBENature.MAX)
     {
         throw new ArgumentOutOfRangeException(nameof(nature));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(queryId, "NatureNames", (byte)nature))[0]));
 }
Exemplo n.º 9
0
 public static PBELocalizedString GetMoveDescription(PBEMove move)
 {
     if (move >= PBEMove.MAX || !Enum.IsDefined(typeof(PBEMove), move))
     {
         throw new ArgumentOutOfRangeException(nameof(move));
     }
     return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(queryId, "MoveDescriptions", (ushort)move))[0]));
 }
Exemplo n.º 10
0
        public static PBELocalizedString GetSpeciesName(PBESpecies species)
        {
            uint speciesId = (ushort)species;

            if (!Enum.IsDefined(typeof(PBESpecies), speciesId))
            {
                throw new ArgumentOutOfRangeException(nameof(species));
            }
            return(new PBELocalizedString(PBEUtils.QueryDatabase <SearchResult>(string.Format(queryId, "SpeciesNames", speciesId))[0]));
        }
        public static PBEMove?GetMoveByName(string moveName)
        {
            PBEMove             move;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "MoveNames", moveName));

            if (results.Count == 1)
            {
                move = (PBEMove)results[0].Id;
            }
            else if (!GetEnumValue(moveName, out move) || move == PBEMove.MAX)
            {
                return(null);
            }
            return(move);
        }
        public static PBEForm?GetFormByName(PBESpecies species, string formName)
        {
            PBEForm form;
            List <FormNameSearchResult> results = PBEUtils.QueryDatabase <FormNameSearchResult>(string.Format(QuerySpeciesAndText, "FormNames", formName, (ushort)species));

            if (results.Count == 1)
            {
                form = (PBEForm)results[0].Form;
            }
            else if (!GetEnumValue(formName, out form))
            {
                return(null);
            }
            return(form);
        }
        public static PBEType?GetTypeByName(string typeName)
        {
            PBEType             type;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "TypeNames", typeName));

            if (results.Count == 1)
            {
                type = (PBEType)results[0].Id;
            }
            else if (!GetEnumValue(typeName, out type))
            {
                return(null);
            }
            return(type);
        }
        public static PBESpecies?GetSpeciesByName(string speciesName)
        {
            PBESpecies          species;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "SpeciesNames", speciesName));

            if (results.Count == 1)
            {
                species = (PBESpecies)results[0].Id;
            }
            else if (!GetEnumValue(speciesName, out species))
            {
                return(null);
            }
            return(species);
        }
        public static PBEStat?GetStatByName(string statName)
        {
            PBEStat             stat;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "StatNames", statName));

            if (results.Count == 1)
            {
                stat = (PBEStat)results[0].Id;
            }
            else if (!GetEnumValue(statName, out stat))
            {
                return(null);
            }
            return(stat);
        }
        public static PBENature?GetNatureByName(string natureName)
        {
            PBENature           nature;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "NatureNames", natureName));

            if (results.Count == 1)
            {
                nature = (PBENature)results[0].Id;
            }
            else if (!GetEnumValue(natureName, out nature) || nature == PBENature.MAX)
            {
                return(null);
            }
            return(nature);
        }
        public static PBEGender?GetGenderByName(string genderName)
        {
            PBEGender           gender;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "GenderNames", genderName));

            if (results.Count == 1)
            {
                gender = (PBEGender)results[0].Id;
            }
            else if (!GetEnumValue(genderName, out gender) || gender == PBEGender.MAX)
            {
                return(null);
            }
            return(gender);
        }
        public static PBEAbility?GetAbilityByName(string abilityName)
        {
            PBEAbility          ability;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "AbilityNames", abilityName));

            if (results.Count == 1)
            {
                ability = (PBEAbility)results[0].Id;
            }
            else if (!GetEnumValue(abilityName, out ability) || ability == PBEAbility.MAX)
            {
                return(null);
            }
            return(ability);
        }
        public static PBEItem?GetItemByName(string itemName)
        {
            PBEItem             item;
            List <SearchResult> results = PBEUtils.QueryDatabase <SearchResult>(string.Format(QueryText, "ItemNames", itemName));

            if (results.Count == 1)
            {
                item = (PBEItem)results[0].Id;
            }
            else if (!GetEnumValue(itemName, out item))
            {
                return(null);
            }
            return(item);
        }
 public static PBELocalizedString GetFormName(PBESpecies species, PBEForm form)
 {
     PBELegalityChecker.ValidateSpecies(species, form, false);
     return(new PBELocalizedString(PBEUtils.QueryDatabase <FormNameSearchResult>(string.Format(QuerySpecies, "FormNames", (ushort)species, (byte)form))[0]));
 }