コード例 #1
0
ファイル: Extractor.cs プロジェクト: Gl0bal06/VoxLotus
        public void StopExtractor(bool notify = true)
        {
            IsActive = false;

            if (notify)
            {
                OnExtractorNotification?.Invoke($"{Name} extractor resource harvesting cancelled.");
            }
        }
コード例 #2
0
ファイル: Extractor.cs プロジェクト: Gl0bal06/VoxLotus
        public void StartExtractor(bool notify = true)
        {
            ticker.ResetToTimeOffset(ProcessingTime);
            IsActive = true;

            if (notify)
            {
                OnExtractorNotification?.Invoke($"{Name} extractors started, they will complete their resource harvesting in {Utilities.ReadableTimeSpan(ProcessingTime, false)}.");
            }
        }
コード例 #3
0
ファイル: Extractor.cs プロジェクト: Gl0bal06/VoxLotus
        protected void OnTickerState(TickerState oldState, TickerState newState)
        {
            switch (newState)
            {
            case TickerState.Disabling:
                OnExtractorNotification?.Invoke($"{Name} extractors will complete their resource harvesting soon.");
                break;

            case TickerState.Disabled:
                OnExtractorNotification?.Invoke($"{Name} extractors have completed their resource harvesting.");
                IsActive = false;
                OnExtractorFinished?.Invoke();
                break;
            }
        }
コード例 #4
0
ファイル: Extractor.cs プロジェクト: Gl0bal06/VoxLotus
        public void ResumeExtractor(long ticks, bool notify = true)
        {
            var timeExpiry = new DateTime(ticks);

            ticker.ResetToTimeSpecific(timeExpiry);
            IsActive = timeExpiry > DateTime.UtcNow;

            if (!notify)
            {
                return;
            }

            if (IsActive)
            {
                OnExtractorNotification?.Invoke($"{Name} extractors resumed, they will complete their resource harvesting in {Utilities.ReadableTimeSpan(timeExpiry.Subtract(DateTime.UtcNow), false)}.");
            }
            else
            {
                OnExtractorNotification?.Invoke($"{Name} extractors completed their resource harvesting {Utilities.ReadableTimeSpan(DateTime.UtcNow.Subtract(timeExpiry), false)} ago.");
            }
        }