Example #1
0
		/// <summary>
		/// Collects appearance data of an item using a specific constructor and parameters list
		/// </summary>
		/// <param name="type">The Type that's being instantiated</param>
		/// <param name="parameters">An array of parameters</param>
		/// <returns>An ItemDef object describing the item created, null in case of failure</returns>
		public static ItemDef GetItemDef( Type type, params object[] parameters )
		{
			ItemDef def = null;

			try
			{
				Item item = Activator.CreateInstance( type, parameters ) as Item;

				if ( item != null )
				{
					def = new ItemDef( item.ItemID, item.Hue );
					item.Internalize();
					item.Delete();
				}
			}
			catch {}

			return def;
		}
Example #2
0
		/// <summary>
		/// Creates a new BoxItem object
		/// </summary>
		public BoxItem()
		{
			m_Item = new ItemDef();
		}