Closed johnameyer closed 5 months ago
Today the various transition functions exist on the same class as the function that returns the mapping.
https://github.com/johnameyer/cards-ts/blob/68a31c74ec2b4799078e894c156a9c5ed6b3ba20/packages/war/src/game-state-transitions.ts#L9-L28
Now that all the functions have the same signature, we can likely just have the class/object be that mapping i.e.
class Transitions { [GameState.START_GAME]() { ... } }
Likely an object to prevent use of this and encourage use of controllers.
this
Today the various transition functions exist on the same class as the function that returns the mapping.
https://github.com/johnameyer/cards-ts/blob/68a31c74ec2b4799078e894c156a9c5ed6b3ba20/packages/war/src/game-state-transitions.ts#L9-L28
Now that all the functions have the same signature, we can likely just have the class/object be that mapping i.e.
Likely an object to prevent use of
this
and encourage use of controllers.