private void Ship(int quantity, SimpleSupply supply) { if (Stock == 0) { throw new ArgumentException(); } Stock -= quantity; supply.Ship(quantity, Price); }
public IEdge AddChild(IAgent child) { var consumer = (SimpleAgent)child; var edge = new SimpleSupply(Price, this, consumer); this.consumers.Add(edge); consumer.supplies.Add(edge); return(edge); }