Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • YEnergy

Index

Constructors

constructor

Methods

Static getGeneratedEnergy

  • getGeneratedEnergy(target: YEntity): number
  • Returns amount of energy generated by target entity.

    Parameters

    Returns number

Static getOtherConnectedEntity

  • getOtherConnectedEntity(entity: YEntity, port: number, connected: (entity: YEntity, port: number) => void, noConnection: () => void): void
  • Returns whether there is another entity connected to the target energy port and allows for additional instructions based on the outcome.

    Parameters

    • entity: YEntity
    • port: number
    • connected: (entity: YEntity, port: number) => void
        • (entity: YEntity, port: number): void
        • Parameters

          Returns void

    • noConnection: () => void
        • (): void
        • Returns void

    Returns void

Static getPortCount

  • getPortCount(target: YEntity): number
  • Returns the number of energy ports of target entity.

    Parameters

    Returns number

Static getRequiredEnergy

  • getRequiredEnergy(target: YEntity): number
  • Returns amount of energy required for target entity to be operational.

    Parameters

    Returns number

Static getUsedEnergy

  • getUsedEnergy(target: YEntity): number
  • Returns amount of energy used by target entity when linked.

    Parameters

    Returns number

Static isEnergyPortConnected

  • isEnergyPortConnected(entity: YEntity, port: number): boolean
  • Returns whether selected port is connected to the power grid.

    Parameters

    Returns boolean

Static linkEnergy

  • Allows to link two energy entities to each other trough specific ports.

    Parameters

    Returns void

  • Allows to link two energy entities to each other automatically.

    Parameters

    Returns void

Static unlinkEnergy

  • unlinkEnergy(entity: YEntity, port: number): void
  • unlinkEnergy(entity: YEntity): void
  • Allows to unlink specific energy port on selected entity.

    Parameters

    Returns void

  • Unlinks all energy ports on selected entity.

    Parameters

    Returns void

Generated using TypeDoc