コード例 #1
0
ファイル: SimpleAgent.cs プロジェクト: AlexeyKhrenov/graphs
        private void Ship(int quantity, SimpleSupply supply)
        {
            if (Stock == 0)
            {
                throw new ArgumentException();
            }

            Stock -= quantity;
            supply.Ship(quantity, Price);
        }
コード例 #2
0
ファイル: SimpleAgent.cs プロジェクト: AlexeyKhrenov/graphs
        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);
        }