An emitter can emit messages when they are requested from other objects. Tipically, emitters emit their short and long descriptions.
Opposite to emitter ability is the sensor ability. Sensors are objects which can receive messages.
#include <ability.h> inherit EMITTER;
void set_req_handler(string type, mixed h)
type
to h
.
If h
is a string, then when a message of type
type
is requested, the string h
will be
returned.
If h
is a function, then when a message of
type type
is requested, the return value of
(*h)(t)
will be returned, where t
is the
type of requested message (t
my differ from
type
). The type of h
should be
string h(string t)
.
If type
ends with a slash '/
' then
all subtypes of type
will be handled by
h
. (For further explanation see messages).
mapping query_req_handlers(string type)
type : handler
.
This mapping describes exactly what function handles what
message type.
void delete_req_handler(string type)
set_req_handler
.
This function deletes the request handler corresponding to
type
.
string request_msg(string type)
type
.
The return value is either 0
if the object
does not handle that type, otherwise a message is
returned.
mapping request_all_msg()
type : message
.
This is primarily useful for debugging purposes and
various other wizard-related things.