• Guides
  • Api Documentation
Show / Hide Table of Contents
  • Discord.Addons.MpGame
    • CurrentlyPlaying
    • GameBase<TPlayer>
    • IMpGameData
    • MpGameModuleBase<TService, TGame, TPlayer>
    • MpGameService<TGame, TPlayer>
    • MpGameService<TGame, TPlayer>.MpGameData
    • Player
  • Discord.Addons.MpGame.Collections
    • CircularLinkedList<T>
    • Hand<T>
    • IWrapper<T>
    • Node<T>
    • Pile<T>
    • WrappingPile<T, TWrapper>
  • Discord.Addons.Preconditions
    • Measure
    • MinimumOnlineUsersAttribute
    • RatelimitAttribute
    • RatelimitFlags
    • RequireLowerHierarchyAttribute
    • RequireRoleAttribute
    • UserMustBeInVoiceAttribute

Class CircularLinkedList<T>

Represents a circular doubly linked list.

Inheritance
Object
CircularLinkedList<T>
Implements
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
Namespace: Discord.Addons.MpGame.Collections
Assembly: Discord.Addons.MpGame.dll
Syntax
public sealed class CircularLinkedList<T> : IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name Description
T

Specifies the element type of the linked list.

Remarks

This code adapted from https://navaneethkn.wordpress.com/2009/08/18/circular-linked-list/

Constructors

| Improve this Doc View Source

CircularLinkedList(IEnumerable<T>)

Initializes a new instance of CircularLinkedList<T>

Declaration
public CircularLinkedList(IEnumerable<T> collection)
Parameters
Type Name Description
IEnumerable<T> collection

Collection of objects that will be added to linked list

| Improve this Doc View Source

CircularLinkedList(IEnumerable<T>, IEqualityComparer<T>)

Initializes a new instance of CircularLinkedList<T>

Declaration
public CircularLinkedList(IEnumerable<T> collection, IEqualityComparer<T> comparer)
Parameters
Type Name Description
IEnumerable<T> collection

Collection of objects that will be added to linked list

IEqualityComparer<T> comparer

Comparer used for item comparison

Properties

| Improve this Doc View Source

Count

Gets total number of items in the list

Declaration
public int Count { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Head

Gets the head node. Returns null if no node found

Declaration
public Node<T> Head { get; }
Property Value
Type Description
Node<T>
| Improve this Doc View Source

Item[Int32]

Gets the item at the current index

Declaration
public Node<T> this[int index] { get; }
Parameters
Type Name Description
Int32 index

Zero-based index

Property Value
Type Description
Node<T>
Exceptions
Type Condition
ArgumentOutOfRangeException

index is out of range

| Improve this Doc View Source

Tail

Gets Tail node. Returns null if no node found

Declaration
public Node<T> Tail { get; }
Property Value
Type Description
Node<T>

Methods

| Improve this Doc View Source

Contains(T)

Determines whether a value is in the list.

Declaration
public bool Contains(T item)
Parameters
Type Name Description
T item

Item to check

Returns
Type Description
Boolean

true if item exist, else false.

| Improve this Doc View Source

Find(T)

Finds the supplied item and returns a node which contains item. Returns null if item not found

Declaration
public Node<T> Find(T item)
Parameters
Type Name Description
T item

Item to search

Returns
Type Description
Node<T>

Node<T> instance or null

| Improve this Doc View Source

GetEnumerator()

Gets a forward enumerator

Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type Description
IEnumerator<T>
| Improve this Doc View Source

GetReverseEnumerator()

Gets a reverse enumerator

Declaration
public IEnumerator<T> GetReverseEnumerator()
Returns
Type Description
IEnumerator<T>

Explicit Interface Implementations

| Improve this Doc View Source

IEnumerable.GetEnumerator()

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
IEnumerator

Implements

System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX