示例#1
0
 public ItemStackTemplate(Asda2ItemId id, int amount)
 {
     this = new ItemStackTemplate(ItemMgr.GetTemplate(id), amount);
     if (m_Template == null)
     {
         throw new ArgumentException("id " + id + " is invalid.");
     }
 }
示例#2
0
 public ItemStackTemplate(Asda2ItemId id)
 {
     this = new ItemStackTemplate(ItemMgr.GetTemplate(id), 1);
     if (this.m_Template == null)
     {
         throw new ArgumentException("ItemId " + (object)id + " is invalid.");
     }
 }
示例#3
0
文件: LootItem.cs 项目: ray2006/WCell
	    /// <summary>
		/// Creates an array of LootItems from the given array of ItemStackDescriptions
		/// </summary>
		/// <param name="descs"></param>
		/// <returns></returns>
		public static LootItem[] Create(ItemStackTemplate[] descs)
		{
			var items = new LootItem[descs.Length];
			for (uint i = 0; i < descs.Length; i++)
			{
				var desc = descs[i];
				items[i] = new LootItem(desc.Template, desc.Amount, i, desc.Template.RandomPropertiesId);
			}
			return items;
		}
示例#4
0
		public NPCLoot(ILootable looted, uint money, ItemStackTemplate[] items)
			: base(looted, money, LootItem.Create(items))
		{
		}
示例#5
0
 public ItemStackTemplate(ItemTemplate templ)
 {
     this = new ItemStackTemplate(templ, templ.MaxAmount);
 }