Beispiel #1
0
        public override async Task <bool> StartTask()
        {
            PluginEvents.CurrentProfileType = ProfileType.Keywarden;

            var keywardenData = GetNext();

            if (keywardenData == null)
            {
                Core.Logger.Log("[Keywardens] Uhm. No eligible keywardens to cook, remaking the game.");
                return(true);
            }

            _keywardenCoroutine = new KeywardenCoroutine(keywardenData);
            return(false);
        }
Beispiel #2
0
        public override async Task <bool> MainTask()
        {
            if (!await _keywardenCoroutine.GetCoroutine())
            {
                return(false);
            }

            _keywardenCoroutine.Dispose();
            _keywardenCoroutine = null;

            var keywardenData = GetNext();

            if (keywardenData != null)
            {
                _keywardenCoroutine = new KeywardenCoroutine(keywardenData);
                return(false);
            }

            return(true);
        }
Beispiel #3
0
        public async Task <bool> Coroutine()
        {
            if (_isDone)
            {
                return(true);
            }
            PluginEvents.PulseUpdates();
            if (!await _keywardenCoroutine.GetCoroutine())
            {
                return(true);
            }
            _keywardenCoroutine.Dispose();
            _keywardenCoroutine = null;
            var keywardenData = GetNext();

            if (keywardenData != null)
            {
                _keywardenCoroutine = new KeywardenCoroutine(keywardenData);
                return(false);
            }
            _isDone = true;
            return(true);
        }
Beispiel #4
0
        public override void OnStart()
        {
            if (!Adventurer.Enabled)
            {
                Logger.Error("Plugin is not enabled. Please enable Adventurer and try again.");
                _isDone = true;
                return;
            }

            PluginEvents.CurrentProfileType = ProfileType.Keywarden;
            if (_keywardenCoroutine == null)
            {
                var keywardenData = GetNext();
                if (keywardenData != null)
                {
                    _keywardenCoroutine = new KeywardenCoroutine(keywardenData);
                }
                else
                {
                    Logger.Info("[Keywardens] Uhm. No eligible keywardens to cook, remaking the game.");
                    _isDone = true;
                }
            }
        }
Beispiel #5
0
 public override void ResetCachedDone(bool force = false)
 {
     _isDone             = false;
     _keywardenCoroutine = null;
 }