Class CircuitSystem
Core system for triggering specified function of entities on stage/map
Methods
BitInt_to_WireConnection(int, out bool, out bool, out bool, out bool)
Convert an intager into wire connection info
Declaration
public static void BitInt_to_WireConnection(int bitInt, out bool connectL, out bool connectR, out bool connectD, out bool connectU)
GetStamp(Int3)
Get unique ID for circuit system at given position in unit space
Declaration
public static int GetStamp(Int3 unitPos)
IsCircuitOperator(int)
True if the given ID is a valid circuit operator entity
Declaration
public static bool IsCircuitOperator(int typeID)
IsWire(int)
True if the given ID is registed as wire
Declaration
public static bool IsWire(int typeID)
OperateCircuit(Int3, int, Direction5)
Perform the function from the operator at given position
Declaration
public static bool OperateCircuit(Int3 unitPos, int stamp = -2147483648, Direction5 circuitFrom = Direction5.Center)
Parameters
Type | Name | Description |
---|---|---|
Int3 | unitPos | Target position in unit space |
int | stamp | unique ID for this operation |
Direction5 | circuitFrom | Which direction does the circuit came from. Set to center to make current as original. |
RegisterWire(int, bool, bool, bool, bool)
Register target IMapItem as wire for operating circuit
Declaration
public static void RegisterWire(int id, bool connectL, bool connectR, bool connectD, bool connectU)
Parameters
Type | Name | Description |
---|---|---|
int | id | ID of the target entity/element |
bool | connectL | True if this wire connect to the wire/operator on left |
bool | connectR | True if this wire connect to the wire/operator on right |
bool | connectD | True if this wire connect to the wire/operator on bottom |
bool | connectU | True if this wire connect to the wire/operator on top |
TriggerCircuit(int, int, int, int, Direction5)
Trigger the system at given position
Declaration
public static void TriggerCircuit(int unitX, int unitY, int unitZ, int stamp = -2147483648, Direction5 startDirection = Direction5.Center)
Parameters
Type | Name | Description |
---|---|---|
int | unitX | Position to start circuit trigger in unit space |
int | unitY | Position to start circuit trigger in unit space |
int | unitZ | Position Z |
int | stamp | unique ID for this operation |
Direction5 | startDirection | Only start at this direction (Set to center to start all direction) |
TryAddBackgroundTrigger(int, Int3)
Add a trigger in background thread
Declaration
public static bool TryAddBackgroundTrigger(int entityID, Int3 unitPos)
Parameters
Type | Name | Description |
---|---|---|
int | entityID | Source ID of this trigger |
Int3 | unitPos | Position in unit space |
Returns
Type | Description |
---|---|
bool | True if the capacity is not reached |
TryRemoveBackgroundTrigger(int, Int3)
Remove the given entity from background thread triggers
Declaration
public static bool TryRemoveBackgroundTrigger(int entityID, Int3 unitPos)
Parameters
Type | Name | Description |
---|---|---|
int | entityID | Source ID of this trigger |
Int3 | unitPos | Position in unit space |
Returns
Type | Description |
---|---|
bool | True if the trigger is removed |
WireConnection_to_BitInt(bool, bool, bool, bool)
Convert wire connection info into an Intager
Declaration
public static int WireConnection_to_BitInt(bool connectL, bool connectR, bool connectD, bool connectU)
WireEntityID_to_WireConnection(int, out bool, out bool, out bool, out bool)
Get connection directions from given wire ID
Declaration
public static bool WireEntityID_to_WireConnection(int id, out bool connectL, out bool connectR, out bool connectD, out bool connectU)
Returns
Type | Description |
---|---|
bool | True if the wire ID is valid |