bucketed_game :: Game :: defaultinit
bucketed_game :: Game :: do_post_turn
Execute something after executing the current GameTurn.bucketed_game :: Game :: do_pre_turn
Execute something before executing the current GameTurn.bucketed_game :: Game :: last_turn
Last turn executed in this gamebucketed_game :: Game :: last_turn=
Last turn executed in this gamebucketed_game $ Game :: SELF
Type of this instance, automatically specialized in every classbucketed_game $ Game :: core_serialize_to
Actual serialization ofself
to serializer
bucketed_game $ Game :: from_deserializer
Create an instance of this class from thedeserializer
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
bucketed_game :: ThinGame :: defaultinit
core :: Object :: defaultinit
bucketed_game :: Game :: defaultinit
bucketed_game :: Game :: do_post_turn
Execute something after executing the current GameTurn.bucketed_game :: Game :: do_pre_turn
Execute something before executing the current GameTurn.serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
bucketed_game :: Game :: last_turn
Last turn executed in this gamebucketed_game :: Game :: last_turn=
Last turn executed in this gameserialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# Full game logic
class Game
super ThinGame
# Game type used in this implementation.
type G: Game
# Bucket list in this 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
# Execute and return a new GameTurn.
#
# This method calls `do_pre_turn` before executing the GameTurn
# and `do_post_turn` after.
fun do_turn: GameTurn[G]
do
var turn = new GameTurn[G](self)
do_pre_turn(turn)
buckets.do_turn(turn)
do_post_turn(turn)
last_turn = turn
tick += 1
return turn
end
# Execute something before executing the current GameTurn.
#
# Should be redefined by clients to add a pre-turn behavior.
# See `Game::do_turn`.
fun do_pre_turn(turn: GameTurn[G]) do end
# Execute something after executing the current GameTurn.
#
# Should be redefined by clients to add a post-turn behavior.
# See `Game::do_turn`.
fun do_post_turn(turn: GameTurn[G]) do end
end
lib/bucketed_game/bucketed_game.nit:204,1--249,3