Перейти к основному содержанию

IElectricItem

Implemented by

Index

Properties

optionalamount

amount?: number

Amount of energy stored in flash items

canProvideEnergy

canProvideEnergy: boolean

If true, energy can be extracted from item

energy

energy: string

Type of energy stored in item

optionalmaxCharge

maxCharge?: number

Energy capacity of item

tier

tier: number

Tier of item. Specifies where item can be charged or discharged.

optionaltransferLimit

transferLimit?: number

Defines limit for transfering energy in item per 1 time

Methods

optionalonCharge

  • onCharge(item: ItemInstance, amount: number, tier: number, addAll?: boolean): number
  • Custom action on charge


    Parameters

    • item: ItemInstance
    • amount: number
    • tier: number
    • optionaladdAll: boolean

    Returns number

optionalonDischarge

  • onDischarge(item: ItemInstance, amount: number, tier: number, getAll?: boolean): number
  • Custom action on discharge


    Parameters

    • item: ItemInstance
    • amount: number
    • tier: number
    • optionalgetAll: boolean

    Returns number