public interface Transaction<T extends GameState>
Modifier and Type | Method and Description |
---|---|
void |
play(T state)
Play this transaction to the game state supplied
|
boolean |
playable(T state)
Check if this transaction can be played back on this game state
Usually you implement this with at least requiring the correct type of GameState
|
JSONObject |
serialize()
Returns a JSON representation of transaction
This can later be recreated by a factory
|
void play(T state)
state
- Game state to modifyboolean playable(T state)
state
- Game state to check for playabilityJSONObject serialize()
TransactionFactory