phaser - v3.90.0
    Preparing search index...

    A Set is a collection of unique elements.

    Type Parameters

    • T
    Index

    Constructors

    • Type Parameters

      • T

      Parameters

      • Optionalelements: T[]

        An optional array of elements to insert into this Set.

      Returns Set<T>

    Properties

    entries: T[]

    The entries of this Set. Stored internally as an array.

    size: number

    The size of this Set. This is the number of entries within it. Changing the size will truncate the Set if the given value is smaller than the current size. Increasing the size larger than the current size has no effect.

    Methods

    • Clears this Set so that it no longer contains any values.

      Returns Set<T>

    • Returns true if this Set contains the given value, otherwise returns false.

      Parameters

      • value: T

        The value to check for in this Set.

      Returns boolean

    • Removes the given value from this Set if this Set contains that value.

      Parameters

      • value: T

        The value to remove from the Set.

      Returns Set<T>

    • Returns a new Set containing all the values in this Set which are not also in the given Set.

      Parameters

      • set: Set<T>

        The Set to perform the difference with.

      Returns Set<T>

    • Dumps the contents of this Set to the console via console.group.

      Returns void

    • Passes each value in this Set to the given callback. Use this function when you know this Set will be modified during the iteration, otherwise use iterate.

      Parameters

      • callback: EachSetCallback<T>

        The callback to be invoked and passed each value this Set contains.

      • OptionalcallbackScope: any

        The scope of the callback.

      Returns Set<T>

    • Get an element of this Set which has a property of the specified name, if that property is equal to the specified value. If no elements of this Set satisfy the condition then this method will return null.

      Parameters

      • property: string

        The property name to check on the elements of this Set.

      • value: T

        The value to check for.

      Returns T

    • Returns an array containing all the values in this Set.

      Returns T[]

    • Returns a new Set that contains only the values which are in this Set and that are also in the given Set.

      Parameters

      • set: Set<T>

        The Set to intersect this set with.

      Returns Set<T>

    • Passes each value in this Set to the given callback.

      For when you absolutely know this Set won't be modified during the iteration.

      The callback must return a boolean. If it returns false then it will abort the Set iteration immediately. If it returns true, it will carry on iterating the next child in the Set.

      Parameters

      • callback: EachSetCallback<T>

        The callback to be invoked and passed each value this Set contains.

      • OptionalcallbackScope: any

        The scope of the callback.

      Returns Set<T>

    • Goes through each entry in this Set and invokes the given function on them, passing in the arguments.

      Parameters

      • callbackKey: string

        The key of the function to be invoked on each Set entry.

      • ...args: any[]

        Additional arguments that will be passed to the callback, after the child.

      Returns Set<T>

    • Inserts the provided value into this Set. If the value is already contained in this Set this method will have no effect.

      Parameters

      • value: T

        The value to insert into this Set.

      Returns Set<T>

    • Returns a new Set containing all values that are either in this Set or in the Set provided as an argument.

      Parameters

      • set: Set<T>

        The Set to perform the union with.

      Returns Set<T>