X-Git-Url: http://nitlanguage.org diff --git a/lib/bucketed_game.nit b/lib/bucketed_game.nit index dc97725..ae0d792 100644 --- a/lib/bucketed_game.nit +++ b/lib/bucketed_game.nit @@ -129,11 +129,12 @@ end # 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 @@ -143,10 +144,10 @@ class GameTurn[G: Game] # 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. @@ -178,8 +179,6 @@ class Game # 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