Inform: How to tell diff. between a room & an item?


Sat, 9 Sep 1995 18:48:33 -0500

How can one tell if an object 'o' is a room or an item? I originally
used this:

if (parent(o) == 0) it's a room

But what about objects in 'nothing'? then I thought:

if (o.&name == 0 && parent(o) == 0) it's a room

But then I realized.. what about the neat feature that roooms have where
you define a 'name' and it says "You don't need to refer to that in the
course of the game."? Now I'm stumped. Maybe this works?:

if (parent(o) == 0 && o.&parse_name == 0) it's a room

How can I tell? I could declare an attribute 'room', but that would be
stupid, and would take a lot of time to go through ALL my approx. 80
rooms or so and add that attribute.

-- 
--- Sam Hulick ------------- shulick@indiana.edu ---------------------
Systems Consultant        | Homepage:
Indiana College Placement |    http://copper.ucs.indiana.edu/~shulick/
  and Assessment Center   | PGP public key available on request