public void ForValueChange(float change) { InventoryUpdateEventArgs instruction = new InventoryUpdateEventArgs(); instruction.totalValueChange = change; EventSubscriber priceUpdater = new EventSubscriber(); valueChange += priceUpdater.onChangeRequest; if (valueChange != null) { valueChange(this, instruction); } }
public void onChangeRequest(object source, InventoryUpdateEventArgs e) { Inventory.TotalValue += e.totalValueChange; }