Aura.Channel.World.Shops.PersonalShop.GetPricedItems C# (CSharp) Метод

GetPricedItems() публичный Метод

Returns new list of all items with prices in shop's bag.
public GetPricedItems ( ) : List
Результат List
		public List<Item> GetPricedItems()
		{
			return this.Owner.Inventory.GetItems(a => a.Info.Pocket == this.Bag.OptionInfo.LinkedPocketId && a.PersonalShopPrice != 0);
		}

Usage Example

Пример #1
0
		/// <summary>
		/// Sends PersonalShopOpenR to creature's client.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="shop">Null for negative response</param>
		public static void PersonalShopOpenR(Creature creature, PersonalShop shop)
		{
			var items = shop.GetPricedItems();

			var packet = new Packet(Op.PersonalShopOpenR, creature.EntityId);
			packet.PutByte(shop != null);
			if (shop != null)
			{
				packet.PutLong(shop.Owner.EntityId);
				packet.PutString(shop.Owner.Name);
				packet.PutString(shop.Description);
				packet.PutString(shop.GetBagLayout());
				packet.PutByte(0);

				foreach (var item in items)
				{
					packet.AddItemInfo(item, ItemPacketType.Private);
					packet.PutInt(item.PersonalShopPrice);
				}
			}

			creature.Client.Send(packet);
		}