Implement short-lived stellar event handling and optimize batch processing; add tests for new functionality

This commit is contained in:
Kirill
2026-09-22 22:50:54 +03:00
parent a3d24114a1
commit d6fd40969f
11 changed files with 238 additions and 41 deletions
+11
View File
@@ -36,6 +36,17 @@ func dispose(world) -> void:
func run() -> void:
var world = fixture()
for id in ["DSN", "SN", "BSN", "HN", "SGRB", "GRB", "LGRB", "HGRB"]:
check(world._evolution_products(world.state, world.entities[id], 3.0).blast == 3.0 * world.entities[id].blast, "Entity blast determines power: " + id)
world.entities.SN.output_and.blast = 999.0
world.entities.SN.blast = 4
check(world._evolution_products(world.state, world.entities.SN, 2.0).blast == 8.0, "Imported output cannot override or double blast power")
world.entities.SN.blast = 0
check(not world._evolution_products(world.state, world.entities.SN, 2.0).has("blast"), "Zero entity blast disables external event")
world.entities.SN.output_or = {"positive": "blast:999", "negative": "blast:999", "chance": 50.0}
check(not world._evolution_products(world.state, world.entities.SN, 2.0).has("blast"), "Alternative output cannot restore disabled blast")
dispose(world)
world = fixture()
var rd = world.entities.RD
check(rd.planets.HP.chance == 0.01, "Preserve fractional planet probability")
check(rd.planets.GG.amount == 2.0 and rd.planets.GG.chance == 0.08, "Read count and chance separately")