A world's events, told each tick to processes that are not its players — a recorder, a referee, a bot that reads the game without playing it.
Cauldron2D.World.Events.subscribe(world)
receive do
{:cauldron_events, world, tick, events} -> ...
endA subscriber gets one message per tick that had events, with the same list the
players get in their frames, until it unsubscribes or exits; world is the world's
pid, and subscribe/1 takes a pid or a registered name.
Summary
Functions
Tell world's subscribers the tick's events; nothing is sent for an empty list.
Receive world's events in the calling process.
Stop receiving them.
Functions
@spec broadcast(pid(), non_neg_integer(), list()) :: :ok
Tell world's subscribers the tick's events; nothing is sent for an empty list.
@spec subscribe(GenServer.server()) :: :ok | {:error, :no_such_world}
Receive world's events in the calling process.
@spec unsubscribe(GenServer.server()) :: :ok
Stop receiving them.