Example #1
0
        private async Task <bool> ChangeHotSpot()
        {
            if (SpawnTimeout > 0 && DateTime.Now < startTime.AddSeconds(SpawnTimeout))
            {
                return(false);
            }

            startTime = DateTime.Now;

            if (HotSpots != null)
            {
                if (!HotSpots.Next())
                {
                    Logger.Info(Localization.ExGather_FinishedLoop, ++loopCount, Loops);

                    // If finished all loops, otherwise just incrementing loop count
                    if (loopCount == Loops)
                    {
                        isDone = true;
                        return(true);
                    }

                    // If not cyclic and it is on the last index
                    if (!HotSpots.IsCyclic && HotSpots.Index == HotSpots.Count - 1)
                    {
                        HotSpots.Index = 0;
                    }
                }
            }

            await Coroutine.Wait(2000, () => !Window <Gathering> .IsOpen && !GatheringMasterpiece.IsOpen);

            return(true);
        }