Ejemplo n.º 1
0
        /// <summary>
        /// Get the GameItem by his name.
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static GameItem Parse(string name)
        {
            GameItem result = Resource.Parse(name);

            if (result == null)
            {
                result = EquipableGlossary.Parse(name);
                if (result == null)
                {
                    if (name == FRUIT_SALAD.Name)
                    {
                        return(FRUIT_SALAD);
                    }
                    else if (name == BANDAGE.Name)
                    {
                        return(BANDAGE);
                    }
                    else if (name == MASO.Name)
                    {
                        return(MASO);
                    }
                    else if (name == FUR.Name)
                    {
                        return(FUR);
                    }
                    else if (name == FEATHER.Name)
                    {
                        return(FEATHER);
                    }
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        public void UnequipItem(Player player, string itemName)
        {
            Equipable item = EquipableGlossary.Parse(itemName);

            if (item != null)
            {
                player.UnequipObject(item);
            }
        }