Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MapView

This is the view of the map, it extends the map which is the raw model and allows to draw it

Hierarchy

Index

Constructors

constructor

Methods

cleanup

  • cleanup(): void
  • Returns void

clearTile

  • clearTile(tile: any): void
  • Resets the tiles content

    Parameters

    • tile: any

    Returns void

drawFactionOverlays

  • drawFactionOverlays(parameters: any): void
  • Draws the faction overlays (e.g. if the opponent is of the red faction, draw a red overlay over his area)

    Parameters

    • parameters: any

    Returns void

drawOuterSpace

  • drawOuterSpace(parameters: any): void
  • Draws the outer space, that is everything which is outside of the tiles. This is visible when zooming out very far on a big screen

    Parameters

    • parameters: any

    Returns void

drawStaticEntities

  • drawStaticEntities(drawParameters: any): void
  • Draws all static entities like buildings etc.

    Parameters

    • drawParameters: any

    Returns void

getBuildingsWithComponentInRange

  • getBuildingsWithComponentInRange(startTile: any, componentClass: any): any
  • Returns all buildings within the transport range which have the given component

    Parameters

    • startTile: any
    • componentClass: any

    Returns any

getEdgyRadiusCanvas

  • getEdgyRadiusCanvas(radiusTiles: any): any
  • Returns the canvas which can be used to visualize the transporter radius as tiles, e.g. when placing a new transporter.

    Parameters

    • radiusTiles: any

      the tile radius to get the canvas for

    Returns any

getEmptyChunkBackground

  • getEmptyChunkBackground(): any
  • Returns the canvas containing the empty background. If a chunk is empty, the empty background is used so we avoid drawing empty chunks all the time.

    Returns any

getEmptyChunkBackgroundDPI

  • getEmptyChunkBackgroundDPI(): any
  • Returns the dpi of the empty chunk background (we need this for rendering)

    Returns any

getTileContent

  • getTileContent(tile: any): any
  • Returns the tile content of a given tile

    Parameters

    • tile: any

    Returns any

    Entity or null

internalCheckTile

  • internalCheckTile(tile: any): void
  • Checks a given tile for validty

    Parameters

    • tile: any

    Returns void

internalGetFactionOverlayPattern

  • internalGetFactionOverlayPattern(parameters: any, faction: any): any
  • Returns the pattern for a given faction

    Parameters

    • parameters: any
    • faction: any

    Returns any

internalGetStripesCanvas

  • internalGetStripesCanvas(): any
  • Internal method to get the stripes canvas from the atlas

    Returns any

internalInitBorders

  • internalInitBorders(): void
  • Returns void

internalInitializeCachedBackgroundCanvases

  • internalInitializeCachedBackgroundCanvases(): void
  • Initializes all canvases used for background rendering

    Returns void

isTileUsed

  • isTileUsed(tile: any): boolean
  • Checks if the tile is used

    Parameters

    • tile: any

    Returns boolean

isValidTile

  • isValidTile(tile: any): boolean
  • Checks if a given tile is within the map bounds

    Parameters

    • tile: any

    Returns boolean

isWithinBorders

  • isWithinBorders(tile: any): boolean
  • Checks if a given tile is within the map bounds, including borders

    Parameters

    • tile: any

    Returns boolean

redrawChunk

  • redrawChunk(chunk: any): void
  • Redraws the background into a chunk

    Parameters

    • chunk: any

    Returns void

regenerateCachedBackgroundPatternsAfterThemeLoaded

  • regenerateCachedBackgroundPatternsAfterThemeLoaded(): void
  • Generates the cached canvas patterns which are used to draw the chunk backgrounds. Must be called after the theme changed (is called on the theme changed hook)

    Returns void

removeEntityFromMap

  • removeEntityFromMap(entity: any): void
  • Removes the entity from the map

    Parameters

    • entity: any

    Returns void

setTileContent

  • setTileContent(tile: any, entity: any): void
  • Sets the tiles content

    Parameters

    • tile: any
    • entity: any

    Returns void