WireSystem
Extends:
Constructor Summary
| Public Constructor | ||
| public |
|
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
staleArea: * |
|
| public |
wireSprites: Object<MetaWireBuilding.wireVariants, Object<enumWireType, AtlasSprite>> |
|
Method Summary
| Public Methods | ||
| public |
drawChunk_WiresForegroundLayer(parameters: import("../../core/draw_utils").DrawParameters, chunk: MapChunkView) Draws a given chunk |
|
| public |
findNetworkForEjector(initialEntity: Entity, slot: import("../components/wired_pins").WirePinSlot) Finds the network for the given slot |
|
| public |
findSurroundingWireTargets(initialTile: Vector, directions: Array<enumDirection>, network: WireNetwork, variantMask: MetaWireBuilding.wireVariants=): Array<any> Finds surrounding entities which are not yet assigned to a network |
|
| public |
getSpriteSetAndOpacityForWire(wireComp: WireComponent): {spriteSet: Object<enumWireType, import("../../core/draw_utils").AtlasSprite>, opacity: number} Returns the given tileset and opacity |
|
| public |
isEntityRelevantForWires(entity: Entity): * Returns whether this entity is relevant for the wires network |
|
| public |
queuePlacementUpdate(entity: Entity) |
|
| public |
queueRecomputeIfWire(entity: Entity) Invalidates the wires network if the given entity is relevant for it |
|
| public |
Recomputes the whole wires network |
|
| public |
update() Updates the wires network |
|
| public |
updateSurroundingWirePlacement(affectedArea: Rectangle) Updates the wire placement after an entity has been added / deleted |
|
Inherited Summary
| From class GameSystem | ||
| public static |
Returns static id |
|
| public |
root: * |
|
| public |
draw(parameters: DrawParameters) Override, do not call this directly, use startDraw() |
|
| public |
Should refresh all caches |
|
| public |
startDraw(parameters: DrawParameters) |
|
| public |
update() Updates the game system, override to perform logic |
|
| From class GameSystemWithFilter | ||
| public |
All entities which match the current components |
|
| public |
|
|
| public |
|
|
| public |
|
|
| public |
internalPopEntityIfMatching(entity: Entity) |
|
| public |
Recomputes all target entities after the game has loaded |
|
| public |
internalPushEntityIfMatching(entity: Entity) |
|
| public |
internalReconsiderEntityToAdd(entity: Entity) |
|
| public |
internalRegisterEntity(entity: Entity) |
|
| public |
|
|
Static Public Methods
Public Constructors
public constructor() source
Constructs a new game system with the given component filter. It will process all entities which have all of the passed components
Override:
GameSystemWithFilter#constructorPublic Members
public networks: Array<WireNetwork> source
public staleArea: * source
public wireSprites: Object<MetaWireBuilding.wireVariants, Object<enumWireType, AtlasSprite>> source
Public Methods
public drawChunk_WiresForegroundLayer(parameters: import("../../core/draw_utils").DrawParameters, chunk: MapChunkView) source
Draws a given chunk
Params:
| Name | Type | Attribute | Description |
| parameters | import("../../core/draw_utils").DrawParameters | ||
| chunk | MapChunkView |
public findNetworkForEjector(initialEntity: Entity, slot: import("../components/wired_pins").WirePinSlot) source
Finds the network for the given slot
Params:
| Name | Type | Attribute | Description |
| initialEntity | Entity | ||
| slot | import("../components/wired_pins").WirePinSlot |
public findSurroundingWireTargets(initialTile: Vector, directions: Array<enumDirection>, network: WireNetwork, variantMask: MetaWireBuilding.wireVariants=): Array<any> source
Finds surrounding entities which are not yet assigned to a network
Params:
| Name | Type | Attribute | Description |
| initialTile | Vector | ||
| directions | Array<enumDirection> | ||
| network | WireNetwork | ||
| variantMask | MetaWireBuilding.wireVariants= | Only accept connections to this mask |
public getSpriteSetAndOpacityForWire(wireComp: WireComponent): {spriteSet: Object<enumWireType, import("../../core/draw_utils").AtlasSprite>, opacity: number} source
Returns the given tileset and opacity
Params:
| Name | Type | Attribute | Description |
| wireComp | WireComponent |
Return:
| {spriteSet: Object<enumWireType, import("../../core/draw_utils").AtlasSprite>, opacity: number} |
public isEntityRelevantForWires(entity: Entity): * source
Returns whether this entity is relevant for the wires network
Params:
| Name | Type | Attribute | Description |
| entity | Entity |
Return:
| * |
public queuePlacementUpdate(entity: Entity) source
Params:
| Name | Type | Attribute | Description |
| entity | Entity |
