gameforge - v0.1.27
    Preparing search index...

    Class List<T>

    Represends a generic doubly-linked list.

    Type Parameters

    • T
    Index

    Constructors

    Accessors

    Methods

    • Determines whether the list contains the specified element.

      Parameters

      • element: T

        The value to check for.

      Returns boolean

      True if the element is found, otherwise false.

    • Finds the first item whose stored value mathes the given element.

      Parameters

      • element: T

        The value to search for.

      Returns undefined | Item<T>

      The matching Item, or undefined if not found.

    • Performs the specified action for each element in a list.

      Parameters

      • callbackfn: (value: T, i: number, list: List<T>) => void

        A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns void

    • Calls a defined callback function on each element of a list, and returns a list that contains the results.

      Type Parameters

      • U

      Parameters

      • callbackfn: (value: T, index: number, list: List<T>) => U

        A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the list.

      • OptionalthisArg: any

        An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

      Returns List<U>

    • Removes and returns the last element of the list.

      Returns undefined | Item<T>

      The removed Item, or undefined if the list is empty.

    • Inserts a new element to the end of the list.

      Parameters

      • element: T

        The element to insert.

      Returns Item<T>

      The created Item wrapping the element.

    • Removes and returns the first element of the list.

      Returns undefined | Item<T>

      The removed Item, or undefined if the list is empty.

    • Inserts a new element at the beginning of the list.

      Parameters

      • element: T

        The element to insert.

      Returns Item<T>

      The created Item wrapping the element.