Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bank

Hierarchy

  • Bank

Index

Constructors

constructor

Properties

bank

bank: ItemBank

Accessors

length

  • get length(): number

Methods

add

addItem

  • addItem(item: number, quantity?: number): this

amount

  • amount(item: string | number): number

clone

filter

  • filter(fn: (item: Item, quantity: number) => boolean, mutate?: boolean): Bank
  • Parameters

    • fn: (item: Item, quantity: number) => boolean
        • (item: Item, quantity: number): boolean
        • Parameters

          • item: Item
          • quantity: number

          Returns boolean

    • Default value mutate: boolean = false

    Returns Bank

fits

  • fits(bank: Bank): number

forEach

  • forEach(fn: (item: Item, quantity: number) => unknown): void
  • Parameters

    • fn: (item: Item, quantity: number) => unknown
        • (item: Item, quantity: number): unknown
        • Parameters

          • item: Item
          • quantity: number

          Returns unknown

    Returns void

has

  • has(items: string | number | (string | number)[] | ItemBank | Bank): boolean

items

  • items(): [Item, number][]

multiply

  • multiply(multiplier: number): this

random

remove

removeItem

  • removeItem(item: number, quantity?: number): this

toString

  • toString(): string

value

  • value(): number

values