Esempio n. 1
0
        /// <summary>
        /// Creates a new static item and adds it to the Prototype cache
        /// </summary>
        /// <returns>The new prototype item</returns>
        public static ItemStatic NewPrototype()
        {
            var newItem = new ItemStatic();

            DataAccess.Add <ItemStatic>(newItem, CacheType.Prototype);
            return(newItem);
        }
Esempio n. 2
0
        /// <summary>
        /// Creates a new static item and adds it to the Instance cache
        /// </summary>
        /// <param name="withPrototype">Whether to also create a backing prototype.</param>
        /// <returns>The new instanced item</returns>
        public static ItemStatic NewInstance(bool withPrototype)
        {
            ItemStatic newItem = new ItemStatic();

            if (withPrototype)
            {
                var newProto = NewPrototype();
                newItem.Prototype = newProto.Prototype;
            }

            DataAccess.Add <ItemStatic>(newItem, CacheType.Instance);

            return(newItem);
        }