szschaler / GridGames

A DSL for developing grid-based arcade-style games. Because, .... fun!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context-dependent state transitions

szschaler opened this issue · comments

Introduce context-dependent state transitions. Some work done, but as I do more of this, I begin to realise that it will require a more substantial reworking of some of the existing stuff. Should really have created a branch for this right away, but hey...

Creating an issue to keep track of the beast.

At the moment, I'm aware I will need:

  1. To extend CellContext to support getting the position/context of a cell in the context. For this it might be best to extract all code generation to do with CellContext into its own generator class so that it is easier to keep this consistent.
  2. To refactor generation of transitions so that I can reuse the code generator both for mouse-triggered and context-triggered (and possibly others later) transitions. Again, it might be useful to extract this into a separate code generator for consistency's sake.
  3. Figure out a way of dealing with recursive context-triggered state changes.

This issue may eventually need breaking up into multiple issues :-)

Branch context-triggers now contains an implementation of CellContext that can generate a new context at each location.

Closing this issue. Recursive triggers are still open, but I am moving them to their own issue.