P
def spawn(%{uuid: uuid} = battle) do
name = {:via, Registry, {@registry, uuid}}
opts = [battle: battle, name: name]
spec = %{
id: uuid |> String.to_atom(),
start: {BattleInstance, :start_link, [opts]},
restart: :temporary
}
DynamicSupervisor.start_child(Game.BattleManager.Supervisor, spec)
end