当前位置: 首页>>代码示例>>C#>>正文


C# PlayerVendor.GetVendorItem方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerVendor.GetVendorItem方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerVendor.GetVendorItem方法的具体用法?C# PlayerVendor.GetVendorItem怎么用?C# PlayerVendor.GetVendorItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerVendor的用法示例。


在下文中一共展示了PlayerVendor.GetVendorItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: processContainer

 private static void processContainer(PlayerVendor vendor, Container container)
 {
     foreach (Item i in container.Items)
     {
         VendorItem vi = vendor.GetVendorItem(i);
         if (vi != null)
         {
             if (vi.IsForSale)
             {
                 MyVendorItem mvi = new MyVendorItem();
                 mvi.Name = vi.Item is BaseContainer ? "container" : StringUtils.GetString(vi.Item.Name, Sphere.ComputeName(vi.Item));
                 mvi.Description = vi.Description;
                 mvi.Price = vi.Price;
                 if (vi.Item is CommodityDeed)
                 {
                     Item commodity = (vi.Item as CommodityDeed).Commodity;
                     if (commodity == null) // skip empty deeds
                         continue;
                     mvi.Amount = commodity.Amount;
                     mvi.Name += " - " + Sphere.ComputeName(commodity);
                 }
                 else
                 {
                     mvi.Amount = vi.Item.Amount;
                 }
                 if (mvi.Amount != 0)
                 {
                     mvi.PricePer = mvi.Price / mvi.Amount;
                 }
                 else
                 {
                     mvi.PricePer = mvi.Price;
                 }
                 mvi.VendorName = vendor.Name;
                 mvi.OwnerName = vendor.Owner.Name;
                 mvi.Location = StringUtils.GetString(vendor.Region.Name, BaseRegion.GetRuneNameFor(vendor.Region)) + " " + vendor.Location.X + "," + vendor.Location.Y;
                 m_VendorItems.Add(mvi);
             }
             else if (vi.Item is Container)
             {
                 processContainer(vendor, vi.Item as Container);
             }
         }
     }
 }
开发者ID:JohnathonReasons,项目名称:runuo-vendor-search,代码行数:45,代码来源:VendorItems.cs

示例2: GetVendorItemsDisplay

 private void GetVendorItemsDisplay(StreamWriter op, PlayerVendor pv, Item item)
 {
 	VendorItem vi = pv.GetVendorItem(item);
 	if ( vi == null )
 		return;
 	
 	if ( vi.IsForSale )
 	{
 		if (pv.Owner == null || pv.Owner.Name == "1k5g6se84f895s854f884s6a") //If name same as this it will not show items in list.
 			return;
 		string ownername = (pv.Name != pv.Owner.Name ? pv.Owner.Name : " ");
 		string name = item.Name;
 		if (string.IsNullOrEmpty(name))
 		{
 			name = item.GetType().ToString();
 			if (name.LastIndexOf('.') >= 0)
 				name = name.Substring(name.LastIndexOf('.') + 1);
 		}
 		if (name.Length > 25)
 			name = name.Substring(0, 25);
 		
 		string des = (string.IsNullOrEmpty(vi.Description) ? " " : vi.Description);
 		op.WriteLine( "<tr><td bgcolor=\"green\"><font color = \"black\"><img src= http://aaaservices.homeip.net/UO/uopics/pouch.bmp align=\"absmiddle\"> {0} </td> <td bgcolor=\"green\"><font color = \"black\"><img src= http://aaaservices.homeip.net/UO/uopics/bodscroll.bmp align=\"absmiddle\"> {1,-25} </td> <td bgcolor=\"green\"><font color = \"black\"><img src= http://aaaservices.homeip.net/UO/uopics/gold.bmp align=\"absmiddle\"> {2,7} </td> <td bgcolor=\"green\"><font color = \"black\"><img src= http://aaaservices.homeip.net/UO/uopics/scroll.bmp align=\"absmiddle\"> {3} </td></tr>", item.Amount, name, vi.Price.ToString(), des );//Note want to add bag icon here
 	}
 	else if ( item is Container)
 	{
 		foreach ( Item containerItem in item.Items)
 		{
 			GetVendorItemsDisplay( op, pv, containerItem);//
 		}
 	}
 }
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:32,代码来源:WebStatus.cs


注:本文中的Server.Mobiles.PlayerVendor.GetVendorItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。