nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9de5255
)
lib: adds reference to last turn in bucketed_game
author
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 3 Mar 2014 16:42:35 +0000
(11:42 -0500)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Mon, 3 Mar 2014 16:42:35 +0000
(11:42 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/bucketed_game.nit
patch
|
blob
|
history
diff --git
a/lib/bucketed_game.nit
b/lib/bucketed_game.nit
index
409b549
..
b326d29
100644
(file)
--- a/
lib/bucketed_game.nit
+++ b/
lib/bucketed_game.nit
@@
-151,6
+151,11
@@
class Game
var buckets: Buckets[G] = new Buckets[G]
+ # Last turn executed in this game
+ # Can be used to consult the latest events (by the display for example),
+ # but cannot be used to add new Events.
+ var last_turn: nullable ThinGameTurn[G] = null
+
init do end
fun do_turn: GameTurn[G]
@@
-161,6
+166,8
@@
class Game
buckets.do_turn(turn)
do_post_turn(turn)
+ last_turn = turn
+
tick += 1
return turn