Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HUDPlaceBuilding2

Hierarchy

Index

Constructors

constructor

Methods

acceptPlacement

  • acceptPlacement(): void
  • Accepts the placement of the building

    Returns void

cleanup

  • cleanup(): void
  • Cleans up everything

    Returns void

close

  • close(): void
  • Should close the element, in case its supported

    Returns void

closeOnBackgroundClick

  • closeOnBackgroundClick(element: any, closeMethod?: any): void
  • Closes this element when its background is clicked

    Parameters

    • element: any
    • Default value closeMethod: any = null

    Returns void

closeOnOverlayOpen

  • closeOnOverlayOpen(closeMethod?: any): void
  • Calls closeMethod if an overlay is opened

    Parameters

    • Default value closeMethod: any = null

    Returns void

closeOverlay

  • closeOverlay(): void
  • Closes the overlay and aborts placement

    Returns void

createElements

  • createElements(parent: any): void

downPreHandler

  • downPreHandler(position: any): string
  • Internal mouse/touch down pre handler

    Parameters

    • position: any

    Returns string

draw

  • draw(parameters: any): void
  • Draws the overlay, updates lots of stuff

    Parameters

    • parameters: any

    Returns void

drawOverlays

  • drawOverlays(parameters: any): void
  • Should draw any overlays (screen space)

    Parameters

    • parameters: any

    Returns void

drawPlacementHelper

  • drawPlacementHelper(parameters: any): void
  • Draws the placement helper which shows the free tiles

    Parameters

    • parameters: any

    Returns void

drawPlacementRadius

  • drawPlacementRadius(parameters: any): void
  • Draws the radius helper which shows the range of transporters

    Parameters

    • parameters: any

    Returns void

findBestAdjacentTile

  • findBestAdjacentTile(): any
  • Finds a good next tile for placement which is directly next to the current tile

    Returns any

    the new tile

findInitialSpot

  • findInitialSpot(centerTile: any): any
  • Finds an initial spot to place the building on, starting at the screen center and searching in a circle arround it

    Parameters

    • centerTile: any

    Returns any

focusOnTile

  • focusOnTile(tile: any): void
  • Focuses the screen on a given tile

    Parameters

    • tile: any

    Returns void

forwardGameSpeedKeybindings

  • forwardGameSpeedKeybindings(sourceMapper: any): void
  • Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such

    Parameters

    • sourceMapper: any

    Returns void

forwardMapMovementKeybindings

  • forwardMapMovementKeybindings(sourceMapper: any): void
  • Forwards the map movement keybindings so you can move the map with the arrow keys

    Parameters

    • sourceMapper: any

    Returns void

forwardSidebarKeybindings

  • forwardSidebarKeybindings(sourceMapper: any): void
  • Forwards the game speed keybindings so you can toggle pause / Fastforward in the building tooltip and such

    Parameters

    • sourceMapper: any

    Returns void

getAcceptButtonElement

  • getAcceptButtonElement(): any
  • Returns the button to accept the placement

    Returns any

getCurrentMetaclass

  • getCurrentMetaclass(): any
  • Returns any

getCurrentTile

  • getCurrentTile(): any
  • Returns any

getIsDragging

  • getIsDragging(): any
  • Returns any

initKeybindings

  • initKeybindings(): void
  • Initializes all keybindings and their labels on the elements

    Returns void

initialize

  • initialize(): void

isBlockingOverlay

  • isBlockingOverlay(): boolean

isVisible

  • isVisible(): boolean
  • Returns boolean

makeActionForPlacement

makePlacementHelperCanvas

  • makePlacementHelperCanvas(): void
  • Initializes the placement helper canvas which shows the free tiles

    Returns void

movePreHandler

  • movePreHandler(position: any): string
  • Internal mouse/touch move pre handler

    Parameters

    • position: any

    Returns string

moveTileRelative

  • moveTileRelative(dx: any, dy: any): void
  • Moves the current tile by the given delta

    Parameters

    • dx: any

      delta tile x

    • dy: any

      delta tile y

    Returns void

onStructurePlaced

  • onStructurePlaced(structure: any): void
  • Structure placed handler

    Parameters

    • structure: any

    Returns void

pinchPreHandler

  • pinchPreHandler(): string
  • Pinch pre handler, aborts pinch if dragging

    Returns string

recomputePlacementHelper

  • recomputePlacementHelper(): void
  • Recomputes the placement helper canvas which shows the free tiles

    Returns void

refreshErrorMessage

  • refreshErrorMessage(message: any): void
  • Updates the placement error message, called from the trackedstate

    Parameters

    • message: any

    Returns void

registerClickDetector

  • registerClickDetector(detector: any): void
  • Registers a new click detector

    Parameters

    • detector: any

    Returns void

rejectPlacement

  • rejectPlacement(): string
  • Rejects the placement

    Returns string

rerenderPlacementCost

  • rerenderPlacementCost(): void
  • Rerenders the placement costs

    Returns void

shouldPauseGame

  • shouldPauseGame(): any

shouldPauseRendering

  • shouldPauseRendering(): boolean

startPlacement

  • startPlacement(metaBuilding: any): void
  • Starts the placement on a given building

    Parameters

    • metaBuilding: any

    Returns void

trackClicks

  • trackClicks(element: any, handler: any, args?: object): void
  • Helper method to construct a new click detector

    Parameters

    • element: any

      The element to listen on

    • handler: any

      The handler to call on this object

    • Default value args: object = {}

      Click detector arguments

    Returns void

upPostHandler

  • upPostHandler(position: any): void
  • Mouse/touch up handler

    Parameters

    • position: any

    Returns void

update

  • update(): void
  • Updates the overlay

    Returns void