[Package Index | Mudlib Index | Effect Index]

File /obj/handlers/chime_handler.c

This handler deals with clocks which chime. It uses a single 15 minute callout to make all clocks on Discworld which choose to chime chime the quarter, half or hours.

Written by Ceres

Includes

This class includes the following files /include/chime.h and /include/am_time.h

Class Index

Method index

Public Functions

These are functions that everyone can access.

query_registered_for
varargs string query_registered_for(object ob,
                                    int num)

Finds out if an object is registered for chimes in a specific interval.

Parameters:
ob - The object to check for
num - The interval to check for, out of CHIME_HOUR, CHIME_HALF_HOUR and CHIME_QUARTER_HOUR. If not given, all types will be checked in order

Returns:
The chime message if registered, else 0


register_for_chimes
int register_for_chimes(object ob,
                        int num,
                        string mess)

Register a clock to do chimes. The num parameter specifes when to chime. If it is 1 then the clock chimes every hour, if it is 2 the clock chimes ever half hour, if it is 4 the clock chimes every quarter hour. Anything else and the clock never chimes. NB: if you set it to chime the quarter hours it will only chime the quarter hours, it will not chime the hours or the half hours. You need to call this function three times to get your clock to chime the hour, half and quarter hours.

The function "chime" will be called on the clock when the chime occurs. The message will be passed in as the first argument, the second will be the type of chime (CHIME_HOUR, CHIME_HALF_HOUR, CHIME_QUARTER_HOUR).

Parameters:
ob - the object being registered
num - when to chime
mess - the message to chime with

Returns:
1 for success, 0 for failure.


Classes

These are nice data types for dealing with... Data!