示例#1
0
        private void BuildQuanta(BluePrintInfo bluePrint)
        {
            var firstLoad = new List<ItemState>();
            var subsequentLoads = new List<ItemState>();

            var quantaFactor = (double)TimeRemaining;
            foreach (var item in bluePrint.Materials)
            {
                var quanta = new ItemState() {Code = item.Code, Quantity = (uint) System.Math.Floor(item.Quantity/quantaFactor)};
                subsequentLoads.Add(quanta);

                firstLoad.Add(new ItemState { Code = item.Code, Quantity = item.Quantity - (uint )System.Math.Floor(quanta.Quantity * (quantaFactor - 1)) } );
            }

            _firstLoad = firstLoad.ToArray();
            _subsequentLoad = subsequentLoads.ToArray();
        }
示例#2
0
 private void SetupItem(BluePrintInfo bluePrint)
 {
     var item = TestItems.BuildItem(bluePrint.Code, bluePrint.TargetQuantity);
     _itemFactory.Setup(f => f.Build(bluePrint.Code, bluePrint.TargetQuantity)).Returns(item);
 }
示例#3
0
文件: Agent.cs 项目: andy-uq/Echo
 public bool CanUse(BluePrintInfo bluePrint)
 {
     Ensure.That(bluePrint).IsNotNull();
     return CanUse(bluePrint.BuildRequirements);
 }
示例#4
0
        public void NewBluePrint()
        {
            var bluePrint = new BluePrintInfo();

            bluePrint.BuildRequirements.ShouldBeEmpty();
            bluePrint.Materials.ShouldBeEmpty();
        }