Aura.Channel.Scripting.Scripts.NpcShopScript.Add C# (CSharp) Метод

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

Adds item to tab.
public Add ( string tabTitle, Item item, int price, int stock ) : void
tabTitle string
item Item
price int Uses db value if lower than 0.
stock int Amount of times item can be bough, unlimited if lower than 0.
Результат void
		public void Add(string tabTitle, Item item, int price, int stock)
		{
			var tab = this.GetOrCreateTab(tabTitle);

			// Use data price if none was set
			if (price == -1)
				price = item.Data.Price;

			// Set stock to given amount or unlimited
			item.Stock = (stock <= 0 ? -1 : stock);

			// Set the price we need
			switch (tab.PaymentMethod)
			{
				case PaymentMethod.Gold: item.SetGoldPrice(price); break;
				case PaymentMethod.Stars: item.OptionInfo.StarPrice = price; break;
				case PaymentMethod.Ducats: item.OptionInfo.DucatPrice = price; break;
				case PaymentMethod.Points: item.OptionInfo.PointPrice = price; break;
			}

			tab.Add(item);
		}

Same methods

NpcShopScript::Add ( string tabTitle, Func shouldDisplay = null ) : NpcShopTab
NpcShopScript::Add ( string tabTitle, bool randomizeColors, Func shouldDisplay = null ) : NpcShopTab
NpcShopScript::Add ( ) : void
NpcShopScript::Add ( string tabTitle, int itemId, int amount = 1, int price = -1, int stock = -1 ) : void
NpcShopScript::Add ( string tabTitle, int itemId, string metaData, int price = -1, int stock = -1 ) : void
NpcShopScript::Add ( string tabTitle, int itemId, uint color1, uint color2, uint color3, int price = -1, int stock = -1 ) : void