bucketed_game :: GameTurn :: act_in
Insert the Bucketable evente
to be executed at tick t
.
bucketed_game :: GameTurn :: act_next
Insert the Bucketable evente
to be executed at next tick.
bucketed_game $ GameTurn :: core_serialize_to
Actual serialization ofself
to serializer
bucketed_game $ GameTurn :: 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 MessagePackbucketed_game :: GameTurn :: act_in
Insert the Bucketable evente
to be executed at tick t
.
bucketed_game :: GameTurn :: act_next
Insert the Bucketable evente
to be executed at next tick.
serialization :: 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
core :: Object :: defaultinit
bucketed_game :: ThinGameTurn :: events=
Game events occurred forself
.
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.
serialization :: 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
bucketed_game :: ThinGameTurn :: tick=
Game tick when happened this turnserialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# Game turn on the full logic
class GameTurn[G: Game]
super ThinGameTurn[G]
# Game that `self` belongs to.
var game: G
# Create a new game turn for `game`.
init(game: G)
is
is_old_style_init
do
_tick = game.tick
_game = game
end
# Insert the Bucketable event `e` to be executed at next tick.
fun act_next(e: Bucketable[G])
do
game.buckets.add_at(e, tick + 1)
game.buckets.delays.inc(1)
end
# Insert the Bucketable event `e` to be executed at tick `t`.
fun act_in(e: Bucketable[G], t: Int)
do
game.buckets.add_at(e, tick + t)
game.buckets.delays.inc(t)
end
# Add and `apply` a game `event`.
fun add_event( event : GameEvent )
do
event.apply( game )
events.add( event )
end
end
lib/bucketed_game/bucketed_game.nit:166,1--202,3