BaseItem
Extends:
Direct Subclass:
Class for items on belts etc. Not an entity for performance reasons
Static Method Summary
| Static Public Methods | ||
| public static |
|
|
| public static |
|
|
Constructor Summary
| Public Constructor | ||
| public |
|
|
Method Summary
| Public Methods | ||
| public |
drawFullSizeOnCanvas(context: CanvasRenderingContext2D, size: number) Draws the item to a canvas |
|
| public |
drawItemCenteredClipped(x: number, y: number, parameters: DrawParameters, diameter: number=) Draws the item at the given position |
|
| public |
drawItemCenteredImpl(x: number, y: number, parameters: DrawParameters, diameter: number=) INTERNAL |
|
| public |
Returns if the item equals the other itme |
|
| public abstract |
equalsImpl(other: BaseItem): boolean Override for custom comparison |
|
| public |
Returns a string id of the item |
|
| public |
|
|
| public |
getItemType(): ItemType |
|
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 getSchema(): object source
Should return the serialization schema
Override:
BasicSerializableObject#getSchemaPublic Constructors
public constructor() source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
BasicSerializableObject#constructorPublic Methods
public drawFullSizeOnCanvas(context: CanvasRenderingContext2D, size: number) source
Draws the item to a canvas
Params:
| Name | Type | Attribute | Description |
| context | CanvasRenderingContext2D | ||
| size | number |
public drawItemCenteredClipped(x: number, y: number, parameters: DrawParameters, diameter: number=) source
Draws the item at the given position
Params:
| Name | Type | Attribute | Description |
| x | number | ||
| y | number | ||
| parameters | DrawParameters | ||
| diameter | number= |
public drawItemCenteredImpl(x: number, y: number, parameters: DrawParameters, diameter: number=) source
INTERNAL
Params:
| Name | Type | Attribute | Description |
| x | number | ||
| y | number | ||
| parameters | DrawParameters | ||
| diameter | number= |
public equals(other: BaseItem): boolean source
Returns if the item equals the other itme
Params:
| Name | Type | Attribute | Description |
| other | BaseItem |
