Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Blueprint

Hierarchy

Index

Constructors

constructor

  • new Blueprint(root: any, meta: any, faction: any): Blueprint
  • Parameters

    • root: any
    • meta: any
    • faction: any

    Returns Blueprint

Methods

addComponent

  • addComponent(componentInstance: any, force?: boolean): void
  • Adds a new component, only possible until the entity is registered on the entity manager, after that use @see EntityManager.addDynamicComponent

    Parameters

    • componentInstance: any
    • Default value force: boolean = false

      Used by the entity manager. Internal parameter, do not change

    Returns void

computeCacheKey

  • computeCacheKey(): string
  • Returns string

deserialize

  • deserialize(data: any): any

distanceToEntity

  • distanceToEntity(other: any): number
  • Returns the world distance to a given entity

    Parameters

    • other: any

    Returns number

draw

  • draw(parameters: any): void
  • Parameters

    • parameters: any

    Returns void

drawBuildStatus

  • drawBuildStatus(context: any): void
  • Parameters

    • context: any

    Returns void

drawImpl

  • drawImpl(parameters: any): void
  • override, should draw the entity

    Parameters

    • parameters: any

    Returns void

drawResourceCollectingStatus

  • drawResourceCollectingStatus(context: any): void
  • Parameters

    • context: any

    Returns void

drawSingleProgressBar

  • drawSingleProgressBar(context: any, x: any, y: any, w: any, progress: any, color: any, sideProgress?: any, barHeight?: number): void
  • Parameters

    • context: any
    • x: any
    • y: any
    • w: any
    • progress: any
    • color: any
    • Default value sideProgress: any = null
    • Default value barHeight: number = 4

    Returns void

drawSingleText

  • drawSingleText(context: any, text: any, font: any, color: any, x: any, y: any): void
  • Parameters

    • context: any
    • text: any
    • font: any
    • color: any
    • x: any
    • y: any

    Returns void

drawWaitingTimeStatus

  • drawWaitingTimeStatus(context: any): void
  • Parameters

    • context: any

    Returns void

getBackgroundCanvas

  • getBackgroundCanvas(): any
  • Returns any

getFactionId

  • getFactionId(): any
  • Returns the string-id of the entities faction

    Returns any

getHasExtendedCullRadius

  • getHasExtendedCullRadius(): boolean
  • override, if true this means this entity draws something outside of his tile, so he will be drawn even if the tile is outside of the view (we check if any of the surrounding tiles is in view additionally)

    Returns boolean

getMetaclass

  • getMetaclass(): any
  • Returns the meta class of the entity.

    Returns any

getPositionTileSpace

  • getPositionTileSpace(): Vector
  • Returns the position in tile space, but not snapped, so it could be 5.5 for example

    Returns Vector

getRecipe

  • getRecipe(): any
  • Returns any

getTile

  • Returns the tile space position

    Returns Vector

getWorldPosition

internalDestroyCallback

  • internalDestroyCallback(): void

isAlive

  • isAlive(): boolean
  • Returns whether the entity is still alive

    Returns boolean

isStunned

  • isStunned(): any
  • Returns if the entity is stunned

    Returns any

isWithinTileRadius

  • isWithinTileRadius(posWorld: any, radiusTiles: any): boolean
  • Checks whether the given world space position is within the given tile radius to the entities center

    Parameters

    • posWorld: any

      The position to check

    • radiusTiles: any

      The maximum distance in tile space

    Returns boolean

    true if the position is within the given range

isWithinTransportRange

  • isWithinTransportRange(otherEntity: any): boolean
  • Checks if the other entity is within the transport range

    Parameters

    • otherEntity: any

    Returns boolean

    true if the entity is within range

removeComponent

  • removeComponent(componentClass: any): void
  • Removes a given component, only possible until the entity is registered on the entity manager, after that use @see EntityManager.removeDynamicComponent

    Parameters

    • componentClass: any

    Returns void

rerenderCache

  • rerenderCache(): void
  • Returns void

serialize

  • serialize(): object

squareDistanceToEntity

  • squareDistanceToEntity(other: any): number
  • Returns the squared world distance to a given entity

    Parameters

    • other: any

    Returns number

squareTileDistanceToEntity

  • squareTileDistanceToEntity(other: any): number
  • Returns the squared tile space distance to a given entity

    Parameters

    • other: any

    Returns number

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string
  • Returns string

Static getSchema

  • getSchema(): any
  • Returns any

Static verify

  • verify(data: any): string