Newsgroups: rec.arts.int-fiction
Path: nntp.gmd.de!news.rwth-aachen.de!news-kar1.dfn.de!news.nacamar.de!howland.erols.net!netcom.com!erkyrath
From: erkyrath@netcom.com (Andrew Plotkin)
Subject: Re: [Inform] Hangers-on?
Message-ID: <erkyrathE1Fs42.JvB@netcom.com>
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: TIN [version 1.2 PL1]
References: <57b31g$bu7@linux.cpsc.ucalgary.ca> <erkyrathE1ErIv.Mpr@netcom.com> <Pine.LNX.3.95.961125003032.29644B-100000@adamant.res.wpi.edu>
Date: Mon, 25 Nov 1996 17:19:13 GMT
Lines: 43
Sender: erkyrath@netcom.netcom.com

George Caswell (timbuktu@adamant.res.wpi.edu) wrote:
> On Mon, 25 Nov 1996, Andrew Plotkin wrote:

> > You could put an after:Go clause on the player. Object orientation isn't 
> > a straightjacket. If you want something happen every time the players 
> > moves successfully, that's a fine place to put the code. 
> > 
>    The object orientation isn't a straightjacket, but all the same you might
> want to think about how you could implement following some sort of standard
> across the project--  especially if there's any chance at all you'll implement
> a second follower or 'guide'.

If I was going to implement a second follower, I'd put two similar 
statements in the after:Go clause. If I wanted a second guide, I'd have 
identical statements in two after:Go clauses. (Either under a conditional 
to check which guide the follower is following, or put that conditional 
inside the follower's "follow" method.)

If I wanted eight followers and seventeen guides, I'd probably wind up 
building the relevant code into classes, so that the after:Go clause gets 
inherited. It would be a little ugly, but that's okay for code which only 
appears once in the source. Maybe use an ofclass loop to go through all 
the followers. Not hugely efficient.

If followers can follow *each other*, whoo hoo. I think I'd wind up with 
a really strange linked list tree, but that's just because I'm like that.

Or else I'd switch to using daemons. This is kind of ugly too. Details 
left to the reader.

Yowza! Idea. Have a set of dummy objects, one for each follower and 
guide. If A is following B, then A's dummy is inside B's dummy. Every 
time one such object moves, it sends a message to its dummy, which passes 
a "follow me" mesage to each of its contents...

Ok, it's a strained idea. It'd work though.

--Z

-- 

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."
