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

Route in-game events

Locates the appropriate module and function for a Kalevala.Event

Link to this section Summary

Callbacks

Parse an input string with the conn as the context

Functions

Macro to generate the receive functions

Link to this section Callbacks

Link to this callback

call(topic, conn, event)

View Source
@callback 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

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