Exemplo n.º 1
0
        /// <summary>
        /// Gets the id of an item, projectile, or buff.
        /// </summary>
        public static List <int> GetIdFromInput(this TShockAPI.Utils util, string input, string name)
        {
            if (input == DbConsts.ItemTable)
            {
                var itemsFound = util.GetItemByName(name);
                return(itemsFound.Select(c => c.netID).ToList());
            }
            else if (input == DbConsts.ProjectileTable)
            {
                return(util.GetProjectileByName(name));
            }
            else if (input == DbConsts.BuffTable)
            {
                return(util.GetBuffByName(name));
            }

            return(default(List <int>));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the id of an item, projectile, or buff.
        /// </summary>
        public static List <int> GetIdFromInput(this Utils util, string section, string name)
        {
            if (section == DbTables.ItemTable)
            {
                var itemsFound = util.GetItemByName(name);
                return(itemsFound.Select(c => c.netID).ToList());
            }

            if (section == DbTables.ProjectileTable)
            {
                return(util.GetProjectileByName(name));
            }

            if (section == DbTables.BuffTable)
            {
                return(util.GetBuffByName(name));
            }

            return(default(List <int>));
        }