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

ChargeItemRegistry

Index

Variables

chargeData

chargeData: {}

Type declaration

Functions

addEnergyTo

  • addEnergyTo(item: ItemInstance, energyType: string, amount: number, tier: number, addAll?: boolean): number
  • Parameters

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

    Returns number

addEnergyToSlot

  • addEnergyToSlot(slot: any, energyType: string, amount: number, tier: number, addAll?: boolean): number
  • Parameters

    • slot: any
    • energyType: string
    • amount: number
    • tier: number
    • optionaladdAll: boolean

    Returns number

addToCreative

  • addToCreative(id: number, energy: number): void
  • Parameters

    • id: number
    • energy: number

    Returns void

getDisplayData

  • getDisplayData(energy: number, maxCharge: number): number
  • Parameters

    • energy: number
    • maxCharge: number

    Returns number

getEnergyFrom

  • getEnergyFrom(item: ItemInstance, energyType: string, amount: number, tier: number, getAll?: boolean): number
  • Parameters

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

    Returns number

getEnergyFromSlot

  • getEnergyFromSlot(slot: any, energyType: string, amount: number, tier: number, getAll?: boolean): number
  • Parameters

    • slot: any
    • energyType: string
    • amount: number
    • tier: number
    • optionalgetAll: boolean

    Returns number

getEnergyStored

  • getEnergyStored(item: ItemInstance, energyType?: string): number
  • Parameters

    • item: ItemInstance
    • optionalenergyType: string

    Returns number

getItemData

getMaxCharge

  • getMaxCharge(id: number, energyType?: string): number
  • Parameters

    • id: number
    • optionalenergyType: string

    Returns number

isFlashStorage

  • isFlashStorage(id: number): boolean
  • Parameters

    • id: number

    Returns boolean

isValidItem

  • isValidItem(id: number, energyType: string, tier: number): boolean
  • Parameters

    • id: number
    • energyType: string
    • tier: number

    Returns boolean

isValidStorage

  • isValidStorage(id: number, energyType: string, tier: number): boolean
  • Parameters

    • id: number
    • energyType: string
    • tier: number

    Returns boolean

registerChargeFunction

  • registerChargeFunction(id: number, func: (item: ItemInstance, amount: number, tier: number, addAll?: boolean) => number): void
  • Parameters

    • id: number
    • func: (item: ItemInstance, amount: number, tier: number, addAll?: boolean) => number

      Returns void

    registerDischargeFunction

    • registerDischargeFunction(id: number, func: (item: ItemInstance, amount: number, tier: number, getAll?: boolean) => number): void
    • Parameters

      • id: number
      • func: (item: ItemInstance, amount: number, tier: number, getAll?: boolean) => number

        Returns void

      registerExtraItem

      • registerExtraItem(id: number, energyType: string, capacity: number, transferLimit: number, tier: number, itemType?: string, addScale?: boolean, addToCreative?: boolean): void
      • @deprecated

        Use registerItem instead


        Parameters

        • id: number
        • energyType: string
        • capacity: number
        • transferLimit: number
        • tier: number
        • optionalitemType: string
        • optionaladdScale: boolean
        • optionaladdToCreative: boolean

        Returns void

      registerFlashItem

      • registerFlashItem(id: number, energyType: string, amount: number, tier?: number): void
      • Parameters

        • id: number
        • energyType: string
        • amount: number
        • optionaltier: number

        Returns void

      registerItem

      • registerItem(id: number, itemData: IElectricItem, inCreative?: boolean): void
      • registerItem(id: number, energyType: string, capacity: number, transferLimit: number, tier?: number, canProvideEnergy?: boolean, inCreative?: boolean): void
      • Parameters

        Returns void

      setEnergyStored

      • setEnergyStored(item: ItemInstance, amount: number): void
      • Parameters

        • item: ItemInstance
        • amount: number

        Returns void

      transferEnergy

      • transferEnergy(api: any, field: any, result: ItemInstance): void
      • Parameters

        • api: any
        • field: any
        • result: ItemInstance

        Returns void