Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
static Cell transition(event, Cell cell) {
List states = state_machine_definition[cell.state]
def transition = states.find { it.event == event }
if (!transition) {
throw new Exception("invalid event $event for state ${cell.state}")
Cell tempCell = new Cell(, cell.lifeLong)
if (transition.afterAction) {
return tempCell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment