# Game turn on the client
class ThinGameTurn[G: ThinGame]
- var tick: Int = 0 is protected writable
- var events: List[GameEvent] = new List[GameEvent] is protected writable
+ # Game tick when `self` should act.
+ var tick: Int is protected writable
- init (t: Int) do tick = t
+ # List of game events occured for `self`.
+ var events = new List[GameEvent] is protected writable
end
# Game turn on the full logic
# Game that `self` belongs to.
var game: G
- init (g: G)
- do
- super(g.tick)
- game = g
+ # Create a new game turn for `game`.
+ init (game: G) is old_style_init do
+ super(game.tick)
+ self.game = game
end
# Insert the Bucketable event `e` to be executed at next tick.
# but cannot be used to add new Events.
var last_turn: nullable ThinGameTurn[G] = null
- init do end
-
# Execute and return a new GameTurn.
#
# This method calls `do_pre_turn` before executing the GameTurn