- Fixed a gigantic bug where, due to a typo, a new circuit was created
for every single wire segment. Oops!
- The wiring phase now has somewhat fewer intermediate parts.
- Power-generating tiles have an explicit update phase, rather than
updating in a method whose name starts with "get".
Anyway it's slightly faster than when I started and that's nice.
Only drawback is that circuit recalculation doesn't quite undo
correctly, but I think the effect is only visual.
If I can get rid of all of these, I can combine multiple undo entries,
and allow undoing backwards in time further (but more coarsely) with the
same memory usage.
This also introduces some actor pooling, which... reduces memory usage
very slightly on clone-heavy levels, but may not be worth it overall.
- Changes to tiles are now stored in a plain object rather than a Map,
which it turns out takes up a decent bit more space.
- Changes to a tile's type or cell no longer need additional closures to
perform the cell movement.
- Less impactful, but changes to level properties are now stored as a
diff, not as a full set every tic.
For example, you can now make connections with the connection tool.
Remarkable.
Unfortunately, implicit connections aren't updated as you edit the level
yet.
Also came with some refactors for searching a level and whatnot.
The default is now what I /think/ is the Lynx behavior: try to push the
block first, and only give it a pending direction if the push fails.
CC2 always uses the pending mechanism.
Since sliding happens either on cell arrival or in the actor's idle
phase, the actor will always have a pending slide by the end of a tic,
so this code doesn't actually do anything.
This seems to simplify things and also explain the CC2 semantics: force
floors activate while being stood on (which happens, I guess, during
idle), so it applies to objects that start the level on force floors.
This was probably done to make force floor flipping work, too. On the
other hand, ice still only activates when being stepped on.
This does simplify things a bit, and it also fixes the replay for CC2LP1
level 160, Sneak Around. It breaks three Voting replays, unfortunately,
but doesn't break anything else, so I'm inclined to call it better.