From caa4878a370ba83194cfccfc47a46c8fe9b95189 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 1 Sep 2020 12:06:29 -0400 Subject: [PATCH] feat: Adding dequeue overload to ScrollSqueue --- ICD.Common.Utils/Collections/ScrollQueue.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ICD.Common.Utils/Collections/ScrollQueue.cs b/ICD.Common.Utils/Collections/ScrollQueue.cs index 5b28acd..8f589a9 100644 --- a/ICD.Common.Utils/Collections/ScrollQueue.cs +++ b/ICD.Common.Utils/Collections/ScrollQueue.cs @@ -101,6 +101,24 @@ namespace ICD.Common.Utils.Collections return output; } + /// + /// Dequeues the next item in the queue. Returns false if the queue is empty. + /// + /// + /// + /// + [PublicAPI] + public bool Dequeue(out TContents item) + { + item = default(TContents); + + if (Count == 0) + return false; + + item = Dequeue(); + return true; + } + /// /// Returns the oldest item in the queue. ///