示例#1
0
        private void Ship(int quantity, SimpleSupply supply)
        {
            if (Stock == 0)
            {
                throw new ArgumentException();
            }

            Stock -= quantity;
            supply.Ship(quantity, Price);
        }
示例#2
0
        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);
        }