Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseTargetMode

Base class for all target modes. A target mode selects entities using a given algorithm, e.g. closest within 3 tiles, same tile, etc.

Hierarchy

Index

Constructors

constructor

  • Constructs a new target mode with the given component filter. Only entities having the given component will be processed by this mode.

    Parameters

    • Default value targetComponent: any = null

    Returns BaseTargetMode

Methods

deserialize

  • deserialize(data: any): any

drawVisualizer

  • drawVisualizer(entity: any, parameters: any, time: any): void
  • Draws the visualizer of the target mode, used for the building tooltip. This should show the range of influence

    Parameters

    • entity: any
    • parameters: any
    • time: any

    Returns void

getDebugString

  • getDebugString(): string
  • Returns string

getTileRadiusForDefenseView

  • getTileRadiusForDefenseView(): any
  • Should return the radius used for rendering the defense view, or null if no radius is available

    Returns any

isTargetAvailable

  • isTargetAvailable(sourceFaction: any, targetEntity: any, root: any): boolean
  • Helper method to check if an entity is available as a target from the given source faction

    Parameters

    • sourceFaction: any
    • targetEntity: any
    • root: any

    Returns boolean

selectTargets

  • selectTargets(sourceEntity: any, root: any, excludeList?: any, sourceFactionOverride?: any): any[]
  • Selects targets from the given source entity

    Parameters

    • sourceEntity: any
    • root: any
    • Default value excludeList: any = null

      Entities to exclude in the returned list

    • Default value sourceFactionOverride: any = null

      Allow to override the faction the damage will come from

    Returns any[]

    Target entities

serialize

  • serialize(): object

Static getCachedSchema

  • getCachedSchema(): any

Static getId

  • getId(): string

Static getSchema

  • getSchema(): object

Static verify

  • verify(data: any): string