[Reality] Exits
Christopher Armstrong
reality@twistedmatrix.com
17 Jun 2002 16:26:23 -0400
>>>>> "Jp" == Jp Calderone <exarkun@meson.dyndns.org> writes:
Jp> On 17 Jun 2002, Christopher Armstrong wrote:
>> >>>>> "Jp" == Jp Calderone <exarkun@meson.dyndns.org> writes:
>>
Jp> On 17 Jun 2002, Christopher Armstrong wrote:
>> Is that all you meant? how about going a bit more in depth for these
>> cases?
Jp> Um, yea, mostly I was just listing some more examples. The only
Jp> real difference most of these would have from ships is they'd be one
Jp> room areas. They also demonstrate why being able to look through an
Jp> entrance might be nice. eg, "look through flap on tent" after you
Jp> "open flap on tent" to see if anyone is inside (and of course, don't
Jp> show anyone inside the oil drum if the top is on).
Jp> Hmmm. One room areas. Would it be worth it to specialize on that
Jp> case? Nah, probably not...
See, we wouldn't necessarily need them to be Areas. They can just be _any_
Thing with an 'entrances' attribute. i.e., a Tent object might have
self.entrances = [Exit(from=OUTSIDE, to=self)], or something like that.
>> That's what the 'entrances' attribute would be (A list of Exit objects
>> meant to be exposed to the containing room). adding and removing stuff
>> from "entrances" can probably be implicit -- that's the point of having
>> Exit objects track what their 'source' and 'dest' properties are. Unless
>> you can come up with another reason for an explicit API :)
Jp> Arg, implicit. Okay, it fits with the rest of Reality, I guess I'll
Jp> just have to get used to it. :)
IMO, it's not too bad at all, because the (defined!) behavior seems pretty
simplistic, and there aren't any whacky cases that I can see that will confuse
people.
Jp> Going back to the case of ships, say we have a hangar with 10
Jp> freighters prepping for launch. "go hatch" just doesn't cut it. "go
Jp> hatch on Sunrise II" works a little better, though "go through the
Jp> hatch on the Sunrise II" is nicest ;) Syntax aside, a way to
Jp> disambiguate entrances is a must. You can't count on the names being
Jp> unique since creators will have no way of knowing in what company their
Jp> ship will eventually end up. Extending ambient_go to recognize
Probably verb_go/enter, if we do end up going with first class Exits.
Jp> "through" and/or "on" and then passing the Thing that is matched by
Jp> those prepositions to findExit() or findDirection() makes sense to me.
Yeah, I agree. This is why sentence needs to be flexible enough to allow
completely "non-conformant" commands, and being able to override object
lookup... or something. I'm tired.
--
Chris Armstrong
<< radix@twistedmatrix.com >>
http://twistedmatrix.com/users/carmstro.twistd/