MapChunkView
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
drawSingleOverviewTile(param0: object) |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(root: GameRoot, x: number, y: number) |
|
Member Summary
| Public Members | ||
| public |
Whenever something changes, we increase this number - so we know we need to redraw |
|
| public |
renderKey: * |
|
Method Summary
| Public Methods | ||
| public |
drawBackgroundLayer(parameters: DrawParameters) Draws the background layer |
|
| public |
drawForegroundDynamicLayer(parameters: DrawParameters) Draws the dynamic foreground layer |
|
| public |
drawForegroundLayer(parameters: DrawParameters, layer: Layer) Draws the layer |
|
| public |
drawForegroundStaticLayer(parameters: DrawParameters) Draws the static foreground layer |
|
| public |
drawOverlay(parameters: DrawParameters) Overlay |
|
| public |
drawWiresForegroundLayer(parameters: DrawParameters) Draws the wires layer |
|
| public |
generateOverlayBuffer(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, w: number, h: number, dpi: number) |
|
| public |
Marks this chunk as dirty, rerendering all caches |
|
Inherited Summary
| From class MapChunk | ||
| public |
|
|
| public |
containedEntitiesByLayer: Record<Layer, Array<Entity>> Which entities this chunk contains, sorted by layer |
|
| public |
Stores the contents of the regular layer |
|
| public |
Stores the contents of the layers |
|
| public |
Stores the contents of the lower (= map resources) layer |
|
| public |
Store which patches we have so we can render them in the overview |
|
| public |
root: * |
|
| public |
Tile space rectangle, can be used for culling |
|
| public |
tileX: * |
|
| public |
tileY: * |
|
| public |
Stores the contents of the wires layer |
|
| public |
World space rectangle, can be used for culling |
|
| public |
x: * |
|
| public |
y: * |
|
| public |
Generates the lower layer "terrain" |
|
| public |
Checks if this chunk has predefined contents, and if so returns true and generates the predefined contents |
|
| public |
getLayerContentFromWorldCoords(worldX: number, worldY: number, layer: Layer): Entity= Returns the contents of this chunk from the given world space coordinates |
|
| public |
getLayersContentsMultipleFromWorldCoords(worldX: number, worldY: number): Array<Entity> Returns the contents of this chunk from the given world space coordinates |
|
| public |
getLowerLayerFromWorldCoords(worldX: number, worldY: number): BaseItem= |
|
| public |
getTileContentFromLocalCoords(localX: number, localY: number): Entity= Returns the chunks contents from the given local coordinates |
|
| public |
getTileContentFromWorldCoords(worldX: number, worldY: number): Entity= Returns the contents of this chunk from the given world space coordinates |
|
| public |
internalGeneratePatch(rng: RandomNumberGenerator, patchSize: number, item: any, overrideX: number=, overrideY: number=) Generates a patch filled with the given item |
|
| public |
setLayerContentFromWorldCords(tileX: number, tileY: number, contents: Entity, layer: Layer) Sets the chunks contents |
|
Public Constructors
Public Members
public renderIteration: number source
Whenever something changes, we increase this number - so we know we need to redraw
public renderKey: * source
Public Methods
public drawBackgroundLayer(parameters: DrawParameters) source
Draws the background layer
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawForegroundDynamicLayer(parameters: DrawParameters) source
Draws the dynamic foreground layer
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawForegroundLayer(parameters: DrawParameters, layer: Layer) source
Draws the layer
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters | ||
| layer | Layer |
public drawForegroundStaticLayer(parameters: DrawParameters) source
Draws the static foreground layer
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawOverlay(parameters: DrawParameters) source
Overlay
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
public drawWiresForegroundLayer(parameters: DrawParameters) source
Draws the wires layer
Params:
| Name | Type | Attribute | Description |
| parameters | DrawParameters |
