Exemple #1
0
        public void Update()
        {
            if (!inited)
            {
                Init();
            }
            _timeKeeper.Tick();
            GetController <IBuildingController>().Update();

            foreach (var inv in GetController <IItemController>().AllInventories)
            {
                _logger.LogError(inv.InventoryUser.Label + " - " + inv.Config.Label + ": " + string.Join(", ", inv.GetAllHeldItems()?.Select(x => x.Label)));
            }

            if (_timeKeeper.IsItTime(HaulTime) > 0)
            {
                HaulTime = _timeKeeper.ProjectTime(new Dictionary <string, int> {
                    { "HOUR", 1 }, { "MIN", 30 }
                });
                DoHaulTest();
            }
        }
Exemple #2
0
 public override void Update()
 {
     if (_growthStage < _stageLengths.Count && _timeKeeper.IsItTime(_finishDate) >= 0)
     {
         _growthStage++;
         if (_growthStage < _stageLengths.Count)
         {
             _finishDate = _timeKeeper.ProjectTime(_stageLengths[_growthStage]);
         }
     }
     if (_growthStage == 3)
     {
         ProduceApple();
         _growthStage = 4;
     }
     if (_growthStage == 4 && _outputInventory.IsEmpty)
     {
         _growthStage = 2;
         _finishDate  = _timeKeeper.ProjectTime(new Dictionary <string, int> {
             { "HOUR", 10 }
         });
     }
 }