Ensage.Common.Objects.UtilityObjects.MultiSleeper.Sleep C# (CSharp) Method

Sleep() public method

The sleep.
public Sleep ( float duration, object id, bool extendCurrentSleep = false ) : void
duration float /// The duration. ///
id object /// The id. ///
extendCurrentSleep bool /// The extend current sleep. ///
return void
        public void Sleep(float duration, object id, bool extendCurrentSleep = false)
        {
            if (!this.LastSleepTickDictionary.ContainsKey(id))
            {
                this.LastSleepTickDictionary.Add(id, Utils.TickCount + duration);
                return;
            }

            if (extendCurrentSleep && this.LastSleepTickDictionary[id] > Utils.TickCount)
            {
                this.LastSleepTickDictionary[id] += duration;
                return;
            }

            this.LastSleepTickDictionary[id] = Utils.TickCount + duration;
        }