Пример #1
0
        /// <summary>
        /// Attempts to locate the given name from the vendor's shop contents
        /// </summary>
        internal static IGameEntity FindEntityInShop(IGameEntity entity, string name)
        {
            IGameEntity foundItem = null;

            if (entity is IVendorNpc)
            {
                var vendor = entity.CastAs <IVendorNpc>();

                // TODO: Check the Vendor's shop for the sale item
            }
            return(foundItem);
        }
Пример #2
0
        /// <summary>
        /// Attempts to locate the given name from equipment
        /// </summary>
        internal static IGameEntity FindEntityInEquipment(IGameEntity entity, string name)
        {
            IGameEntity foundEntity = null;

            if (entity is IBiota)
            {
                var biote = entity.CastAs <IBiota>();
                // TODO: Check the Biote's equipment for the item
                //return biote.Inventory.Equipment.Values.FirstOrDefault(item => item.CompareName(name));
            }
            return(foundEntity);
        }
Пример #3
0
        /// <summary>
        /// Attempts to locate the given name from the entity's recipe list
        /// </summary>
        internal static IGameEntity FindEntityInRecipes(IGameEntity entity, string name)
        {
            IGameEntity foundItem = null;

            if (entity is ICharacter)
            {
                var character = entity.CastAs <ICharacter>();
                // TODO: Check the Character's Recipes for the item

                /*return character.RecipeRepository.Keys.Select(recipeId => character.RecipeRepository.Get(recipeId))
                 * .FirstOrDefault(formula => formula.CompareName(name));*/
            }
            return(foundItem);
        }