ShapeDefinition
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
fromShortKey(key: string): ShapeDefinition Generates the definition from the given short key |
|
| public static |
|
|
| public static |
getSchema(): {} |
|
| public static |
isValidShortKey(key: string): boolean Checks if a given string is a valid short key |
|
| public static |
isValidShortKeyInternal(key: string): boolean INTERNAL Checks if a given string is a valid short key |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(param0: object) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
layers: * |
|
Method Summary
| Public Methods | ||
| public |
cloneAndPaintWith(color: enumColors): * Clones the shape and colors everything in the given color |
|
| public |
cloneAndPaintWith4Colors(colors: [enumColors, enumColors, enumColors, enumColors]): * Clones the shape and colors everything in the given colors |
|
| public |
cloneAndStackWith(definition: ShapeDefinition): * Stacks the given shape definition on top. |
|
| public |
cloneFilteredByQuadrants(includeQuadrants: Array<number>): ShapeDefinition Returns a definition with only the given quadrants |
|
| public |
Returns a definition which was rotated 180 degrees |
|
| public |
Returns a definition which was rotated counter clockwise |
|
| public |
Returns a definition which was rotated clockwise |
|
| public |
deserialize(data: *): * |
|
| public |
drawCentered(x: number, y: number, parameters: DrawParameters, diameter: number=) Draws the shape definition |
|
| public |
drawFullSizeOnCanvas(context: CanvasRenderingContext2D, size: number) Draws the item to a canvas |
|
| public |
generateAsCanvas(size: number): * Generates this shape as a canvas |
|
| public |
Returns a unique id for this shape |
|
| public |
Internal method to clone the shape definition |
|
| public |
internalGenerateShapeBuffer(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, w: number, h: number, dpi: number) |
|
| public |
Returns if the definition is entirely empty^ |
|
| public |
serialize(): * |
|
Inherited Summary
| From class BasicSerializableObject | ||
| public static |
|
|
| public static |
getId() |
|
| public static |
Should return the serialization schema |
|
| public static |
|
|
| public |
deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void |
|
| public |
|
|
Static Public Methods
public static fromShortKey(key: string): ShapeDefinition source
Generates the definition from the given short key
Params:
| Name | Type | Attribute | Description |
| key | string |
public static getSchema(): {} source
Should return the serialization schema
Override:
BasicSerializableObject#getSchemaReturn:
| {} |
Public Constructors
public constructor(param0: object) source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
BasicSerializableObject#constructorParams:
| Name | Type | Attribute | Description |
| param0 | object | ||
| param0.layers | Array<ShapeLayer>= |
Public Methods
public cloneAndPaintWith(color: enumColors): * source
Clones the shape and colors everything in the given color
Params:
| Name | Type | Attribute | Description |
| color | enumColors |
Return:
| * |
public cloneAndPaintWith4Colors(colors: [enumColors, enumColors, enumColors, enumColors]): * source
Clones the shape and colors everything in the given colors
Params:
| Name | Type | Attribute | Description |
| colors | [enumColors, enumColors, enumColors, enumColors] |
Return:
| * |
public cloneAndStackWith(definition: ShapeDefinition): * source
Stacks the given shape definition on top.
Params:
| Name | Type | Attribute | Description |
| definition | ShapeDefinition |
Return:
| * |
public cloneFilteredByQuadrants(includeQuadrants: Array<number>): ShapeDefinition source
Returns a definition with only the given quadrants
public cloneRotateCCW(): ShapeDefinition source
Returns a definition which was rotated counter clockwise
public deserialize(data: *): * source
Override:
BasicSerializableObject#deserializeParams:
| Name | Type | Attribute | Description |
| data | * |
Return:
| * |
public drawCentered(x: number, y: number, parameters: DrawParameters, diameter: number=) source
Draws the shape definition
Params:
| Name | Type | Attribute | Description |
| x | number | ||
| y | number | ||
| parameters | DrawParameters | ||
| diameter | number= |
public drawFullSizeOnCanvas(context: CanvasRenderingContext2D, size: number) source
Draws the item to a canvas
Params:
| Name | Type | Attribute | Description |
| context | CanvasRenderingContext2D | ||
| size | number |
public generateAsCanvas(size: number): * source
Generates this shape as a canvas
Params:
| Name | Type | Attribute | Description |
| size | number |
Return:
| * |
public internalCloneLayers(): Array<ShapeLayer> source
Internal method to clone the shape definition
