Beispiel #1
0
 public void SetNext([NotNull] PlayerQueueEntry entry)
 {
     if (Next == null)
     {
         Next       = entry;
         entry.Prev = (PlayerQueueEntry)this;
     }
     else
     {
         Next.SetNext(entry);
     }
 }
Beispiel #2
0
 public bool Remove([NotNull] PlayerQueueEntry entry)
 {
     if (Next == null)
     {
         return(false);
     }
     if (Next == entry)
     {
         using var tmp = Next;
         Next          = tmp.Next;
         return(true);
     }
     else
     {
         return(Next.Remove(entry));
     }
 }
Beispiel #3
0
 public bool Swap(
     [NotNull] PlayerQueueEntry oldEntry,
     [NotNull] PlayerQueueEntry newEntry)
 {
     if (Next == null)
     {
         return(false);
     }
     if (Next == oldEntry)
     {
         Next      = newEntry;
         Next.Prev = oldEntry.Prev;
         Next.Next = oldEntry.Next;
         return(true);
     }
     else
     {
         return(Next.Swap(oldEntry, newEntry));
     }
 }
Beispiel #4
0
        public void Clear()
        {
            if (Prev != null)
            {
                Entry tmp = Prev;
                Prev = null;
                if (tmp != this)
                {
                    tmp.Clear();
                }
            }

            if (Next != null)
            {
                Entry tmp = Next;
                Next = null;
                if (tmp != this)
                {
                    tmp.Clear();
                }
            }

            ((PlayerQueueEntry)this).Dispose();
        }