/// <summary> /// Sets the execute time for the next item in the queue /// </summary> public void AddTime() { if (EmoteQueue.Count == 0) { return; } var emote = EmoteQueue.Peek(); emote.ExecuteTime = DateTime.UtcNow.AddSeconds(emote.Data.Delay); }
/// <summary> /// Sets the execute time for the next item in the queue /// </summary> public void AddTime() { if (EmoteQueue.Count == 0) { return; } var emote = EmoteQueue.Peek(); emote.ExecuteTime = Timer.CurrentTime + emote.Data.Delay; }
public void ExecuteSet(EmoteSet emoteSet, WorldObject target) { if (EndTime < DateTime.UtcNow) { EndTime = DateTime.UtcNow; } double queueTime = 0.0; foreach (var emote in emoteSet.Emotes) { queueTime += emote.Delay; EmoteQueue.Enqueue(new QueuedEmote(emote, target, DateTime.UtcNow.AddSeconds(queueTime))); } }
public void ExecuteSet(EmoteSet emoteSet, WorldObject target) { if (EndTime < Timer.CurrentTime) { EndTime = Timer.CurrentTime; } double queueTime = 0.0; foreach (var emote in emoteSet.Emotes) { queueTime += emote.Delay; EmoteQueue.Enqueue(new QueuedEmote(emote, target, Timer.CurrentTime + queueTime)); } }
/// <summary> /// Processes the emote queue /// </summary> public void ProcessQueue() { while (EmoteQueue.Count > 0) { var emote = EmoteQueue.Peek(); if (emote.ExecuteTime > DateTime.UtcNow || WorldObject.IsBusy || WorldObject.IsMovingTo) { break; } EmoteQueue.Dequeue(); AddTime(); } }
public void Cancel() { EmoteQueue.Clear(); }