Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Bank

Hierarchy

  • Bank

Index

Constructors

constructor

Properties

bank

bank: ItemBank

frozen

frozen: boolean = false

Accessors

length

  • get length(): number

Methods

add

addItem

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

amount

  • amount(item: string | number): number

clone

difference

equals

  • equals(otherBank: Bank): boolean

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

freeze

  • freeze(): this

has

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

items

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

multiply

  • multiply(multiplier: number, itemsToNotMultiply?: number[]): this

random

remove

removeItem

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

toString

  • toString(): string

value

  • value(): number