Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ItemSockets

item component for sockets

Hierarchy

  • ItemSockets

Implements

Index

Constructors

constructor

  • Parameters

    • item: Item
    • builder: Builder

    Returns ItemSockets

Properties

groups

groups: SocketGroup[]

parent

parent: Item

sockets

sockets: Socket[]

Methods

any

  • any(): boolean
  • Returns boolean

builder

  • builder(): { groups: number[][]; sockets: Socket[] }
  • Returns { groups: number[][]; sockets: Socket[] }

    • groups: number[][]
    • sockets: Socket[]

color

  • Parameters

    Returns Item

colorBatch

  • Parameters

    Returns Item

colors

  • Returns SocketColor[]

count

  • count(): number
  • Returns number

isLinked

  • Parameters

    Returns boolean

link

  • links the specified socket indices

    Parameters

    • Rest ...pairs: SocketId[]

      consider args as pairs so be sure to have even argument length

    Returns Item

mapColors

  • Parameters

    • fn: (socket: Socket, index: number, item: Item) => Socket

      if fn returns a referentially equal Socket no new item is returned

    Returns Item

max

  • max(): number
  • deprecated

    Returns number

maxLinks

  • maxLinks(): number
  • Returns number

maxSockets

  • maxSockets(): number
  • calculates the maximum amount of sockets possible on this item

    TODO: what about Corroded Blades or other similar 1x4 Items. Confirm that they also only can have max 4 sockets like Rods or act like small_Staff

    Returns number

socket

  • set the sockets to {n}

    set force to true to ignore socket limit set keep_links to false if the new sockets should all be unlinked newSocket is a callback which is called for every new socket. By default a white socket is created.

    Parameters

    Returns Item

toJson

  • toJson(): Array<Socket & { group: number }>
  • serialized format which includes group information

    Returns Array<Socket & { group: number }>

toString

  • toString(): string
  • a string representation of the sockets, links and colors

    each char represents a color shorthand, dashes means the adjacent sockets are linked, whitespace instead means no link

    Returns string

Generated using TypeDoc