SYNOPSIS
/* A room, used as port */
inherit "/room/port"; /* Instead of "std/room" */
#include <properties.h>
.
.
.
DESCRIPTION
The special funktions of /room/port.c only work with the
/obj/ship.c. The ship object calls every given port for
response. port.c catch this call and creates an alist (mixed *ships)
where all ships are stored wich have called this port. If any object
calls the init() in port.c (p.e. a player enters the port) port.c will
send any message to all ships stored in the alist. These ships will come
soon to this port. port.c creates a time table where all stored ships
are shown. The player can look at them by typing "exa table" or such.
You should tell the player of this table in SetRoomLong(), the time table is
no object!
Functions:
void HideTable() / UnhideTable()
Makes the time table (in)visible.
void SetAutocall(int mode)
Sets if the ships should be automaticly called if a player enters the
harbour. mode == 0 don't call a ship.
mixed *table()
returns an array of two arrays.
table()[0] contains the ships that have called this port.
If the ship <nr> isn't accessible table()[0][nr] == 0.
table()[1] contains the number that this port has in the list of the
ports of the ship table()[0].
If the ship <nr> isn't accessible table()[1][nr] == 0.
Synopsis:
mixed *shiplist;
.
.
.
shiplist = table();
int QueryShipCount()
Returns the number of ships that called this port.
int CallShip(int nr)
Calls the ship in table()[0][nr]. If table()[0][nr] == 0 it produces an
error.
If the ship table()[0][nr] not accessible it returns 0 and sets
table()[0][nr] = and table()[1][nr] = 0.
If not, it returns 1.
int call_ships()
Call all ships in table() with test of accessiblity. If it could called
some ships it returns the quantity of these ships. If not, it returns 0,
table() is set to ({({}),({})}), QueryShipCount() returns 0.
AddShip(string path)
Adds the ship referenced by path to the list of preload ships in this
harbour. The ship must define this harbour itself by using AddPort().
SEE ALSO
/doc/std/ship