|
|
@@ -48,30 +48,6 @@ namespace GamecraftModdingAPI.Blocks |
|
|
|
IsInGame = true; |
|
|
|
} |
|
|
|
|
|
|
|
public void DoTheThing() |
|
|
|
{ |
|
|
|
GamecraftModdingAPI.Tasks.Repeatable thing = new GamecraftModdingAPI.Tasks.Repeatable( |
|
|
|
() => { Thing(); }, |
|
|
|
() => { return IsSimulationMode(); } ); |
|
|
|
GamecraftModdingAPI.Tasks.Scheduler.Schedule(thing); |
|
|
|
} |
|
|
|
|
|
|
|
public void Thing() |
|
|
|
{ |
|
|
|
uint count = 0; |
|
|
|
EGID[] eBlocks = GetElectricBlocks(); |
|
|
|
for (uint i = 0u; i < eBlocks.Length; i++) |
|
|
|
{ |
|
|
|
uint[] ids = GetSignalIDs(eBlocks[i]); |
|
|
|
for (uint j = 0u; j < ids.Length; j++) |
|
|
|
{ |
|
|
|
SetSignal(ids[j], (float)random.NextDouble()); |
|
|
|
count++; |
|
|
|
} |
|
|
|
} |
|
|
|
Logging.Log($"Did the thing on {count} inputs"); |
|
|
|
} |
|
|
|
|
|
|
|
// implementations for Signal static class |
|
|
|
|
|
|
|
public bool SetSignal(EGID blockID, float signal, out uint signalID, bool input = true) |
|
|
|