Kalevala.World.BasicRoom (kalevala v0.1.0) View Source

A basic room

These are the minimum fields a room should have. You likely want more, so we have a protocol Kalevala.World.Room.Callbacks to let you create your own local struct.

The following functions provide default implementations you can use for the defimpl of that protocol.

defimpl Kalevala.World.Room.Callbacks do
  alias Kalevala.World.BasicRoom

  @impl true
  def movement_request(_room, context, event, room_exit),
    do: BasicRoom.movement_request(context, event, room_exit)

  @impl true
  def confirm_movement(_room, context, event),
    do: BasicRoom.confirm_movement(context, event)

  @impl true
  def item_request_drop(_room, context, event, item_instance),
    do: BasicRoom.item_request_drop(context, event, item_instance)

  @impl true
  def item_request_pickup(_room, context, event, item_instance),
    do: BasicRoom.item_request_pickup(context, event, item_instance)

  # ...
end

Link to this section Summary

Link to this section Functions

Link to this function

confirm_movement(context, event)

View Source
Link to this function

item_request_drop(context, event, item_instance)

View Source
Link to this function

item_request_pickup(context, event, item_instance)

View Source
Link to this function

movement_request(context, event, room_exit)

View Source