Kalevala.Event.Router behaviour (kalevala v0.1.0) View Source

Route in-game events

Locates the appropriate module and function for a Kalevala.Event

Link to this section Summary

Functions

Macro to generate the receive functions

Callbacks

Parse an input string with the conn as the context

Link to this section Functions

Link to this macro

scope(module, opts)

View Source (macro)

Macro to generate the receive functions

scope(App) do
  module(CombatEvent) do
    event("combat/start", :start)
    event("combat/stop", :stop)
  end
end

Link to this section Callbacks

Link to this callback

call(topic, conn, event)

View Source

Specs

call(
  topic :: Kalevala.Event.topic(),
  conn :: Kalevala.Character.Conn.t(),
  event :: Kalevala.Event.t()
) :: :ok

Parse an input string with the conn as the context