Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!Dortmund.Germany.EU.net!Germany.EU.net!howland.reston.ans.net!vixen.cso.uiuc.edu!usenet.ucs.indiana.edu!news.cs.indiana.edu!shulick@guava.ucs.indiana.edu
From: "Sam Hulick" <shulick@guava.ucs.indiana.edu>
Subject: Inform: How to tell diff. between a room & an item?
Message-ID: <1995Sep9.184839.13884@news.cs.indiana.edu>
Organization: Vallen Software
Date: Sat, 9 Sep 1995 18:48:33 -0500
Lines: 25


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
