private void PendTransfer()
        {
            if (Mathf.CeilToInt(_currentTime) == 0)
            {
                _done = true;

                QuickLogger.Debug($"Done: {_done}");

                var listOfItems = _items.ToList();

                for (int i = 0; i < _items.count; i++)
                {
                    _itemsToRemove.Add(listOfItems[i].item);
                }

                foreach (Pickupable pickupable in _itemsToRemove)
                {
                    if (_target.HasRoomFor(pickupable))
                    {
                        _mono.RemoveItem(pickupable);
                        _target.AddItem(new InventoryItem(pickupable));
                    }
                }

                ErrorMessage.AddMessage($"[{_target.Name} Message]: Shipment has arrived!");

                _itemsToRemove.Clear();
                _target.Recieved = true;
                _currentTime     = ResetTime;
                _mono.OnItemSent?.Invoke();
                _target.OnItemSent?.Invoke();
                _target.IsReceivingTransfer = false;

                _items  = null;
                _target = null;
            }
            else
            {
                _currentTime -= 1 * DayNightCycle.main.deltaTime;
            }

            if (_target != null)
            {
                _target.OnTimerChanged?.Invoke(TimeConverters.SecondsToHMS(_currentTime));
            }
            _mono.OnTimerChanged?.Invoke(TimeConverters.SecondsToHMS(_currentTime));
        }
Exemplo n.º 2
0
        private void Desterilize()
        {
            if (_isDirty)
            {
                return;
            }

            if (QPatch.Configuration.Config.GetsDirtyOverTime)
            {
                _unitSanitation -= DayNightCycle.main.deltaTime;
                if (_unitSanitation <= 0)
                {
                    QuickLogger.Debug("Unit is dirty");
                    _isDirty        = true;
                    _unitSanitation = ThirtyDays;
                }
            }

            _mono.DisplayManager.UpdateTimeLeft(TimeConverters.SecondsToHMS(_unitSanitation));
        }
        private string TimeTilRefuel()
        {
            var mod = _timeLeft % KDayInSeconds;

            return(TimeConverters.SecondsToHMS(mod));
        }