Manual:DIL Manual/roomcount

From DikuMUD Wiki
Jump to navigation Jump to search

roomcount

Field (integer, read-only; on a zoneptr).

z.roomcount : integer

The number of rooms the zone defines: the rooms read from its .data file at boot.

Notes

  • It can't be assigned (vmc: "Illegal lvalue").
  • On a null zoneptr it fails.
  • Its companions objcount and npccount are always 0.

Example

dilbegin integer world_rooms();
var
   z : zoneptr;
   n : integer;
code
{
   n := 0;
   z := zhead();
   while (z)
   {
      n := n + z.roomcount;
      z := z.next;
   }
   return (n);
}
dilend

Counts the rooms of all zones.

See also