NetrunnerMopus / data-hunt

Netrunner for the masses
The Unlicense
12 stars 4 forks source link

Display timing structures as nested brackets #2035

Open dagguh opened 3 years ago

dagguh commented 3 years ago

Sneak peek: image

Gotta:

dagguh commented 3 years ago

Vertical shrinking was trivial: image

Now I'm fixing the bug with action brackets opening in the past turns. It's a big problem, because the whole code assumed that there's the game.corp.turn and the game.runner.turn without considering that they pass. The CorpTurn and RunnerTurn classes begun as stateless, so it was never a problem. The only state they got was event handlers. The old TimeCross was only appending immutable views, so representations of past actions weren't affected by that shared state. But now I'm registering dynamic views of turns/actions, so the classes. I'm rewriting the timing code to create new instances of turns, action windows, etc. instead of relying on mutable singletons.

dagguh commented 3 years ago

The bug uncovered a ton of fundamental bad design. The timings were done ad hoc. Sometimes opening of a priority window was done as a cost, sometimes as a C# Task, sometimes relying on the GUI rather than the engine, sometimes as callbacks. I started remodelling the timing and priority according to the game rules: #2036