public ItemVendorProductMessage() { this.itemAmount = new ItemAmountMessage() { itemInstance = new RegisterItemInstanceMessage(), amount = 0 }; buyPrice = new CurrencyDecoratorMessage[0]; sellPrice = new CurrencyDecoratorMessage[0]; }
public ItemVendorProductMessage(IVendorProduct <IItemInstance> product, int amount) { this.itemAmount = new ItemAmountMessage() { itemInstance = new RegisterItemInstanceMessage(product.item), amount = (ushort)amount }; buyPrice = new CurrencyDecoratorMessage[product.buyPrice.Length]; for (int i = 0; i < product.buyPrice.Length; i++) { buyPrice[i] = new CurrencyDecoratorMessage(product.buyPrice[i]); } sellPrice = new CurrencyDecoratorMessage[product.sellPrice.Length]; for (int i = 0; i < product.sellPrice.Length; i++) { sellPrice[i] = new CurrencyDecoratorMessage(product.sellPrice[i]); } }