Hixie/cuddlyworld-ide

TThingPosition dropdown should be more helpful

Hixie opened this issue · 1 comments

Hixie commented
TThingPosition dropdown should be more helpful
Hixie commented

server code says:

type
   { Ambiguous means that the placement is made explicit in the name (e.g. "rim" + "of bag") }
   { Implicit means that the thing isn't mentioned when looking at its parent }
   { Currently, only one tpOpening is allowed per thing, and IsChildTraversable() must always return true for that child.
     We could relax this by changing GetInside() to GetOpenings() and making everything disambiguate wherever we are currently
     using GetInside() instead of having it assume it's one or nil. }
   { See further notes below for other implications of these values }
   TThingPosition = (tpPartOfImplicit, tpAmbiguousPartOfImplicit, tpAroundImplicit, tpAtImplicit, tpOnImplicit, tpPlantedInImplicit,
                     tpDirectionalOpening, tpDirectionalPath,
                     tpSurfaceOpening, tpAt, tpOn, tpPlantedIn, tpInstalledIn, tpIn, tpEmbedded, tpCarried);
   TThingPositionFilter = set of TThingPosition;

const
   tpEverything = [Low(TThingPosition) .. High(TThingPosition)];
   tpAutoDescribe = [tpSurfaceOpening, tpAt, tpPlantedIn]; { things that should be included in the main description of an object }
   tpAutoDescribeDirectional = [tpDirectionalOpening, tpDirectionalPath]; { things that should be included in the main description of a location, with a direction (these also have to be part of the FDirectionalLandmarks arrays, and not tpContained in something else) }
   tpScenery = [tpPartOfImplicit, tpAmbiguousPartOfImplicit, tpAroundImplicit, tpAtImplicit, tpOnImplicit, tpDirectionalOpening, tpDirectionalPath, tpSurfaceOpening, tpAt]; { parent includes the mass of these children already, and conceptually these children essentially _are_ the parent, or at least part of it }
   tpObtrusive = [tpPlantedInImplicit, tpOn, tpPlantedIn, tpIn, tpEmbedded, tpCarried]; { used by GetObtrusiveObstacles(); these are things that can be shaken loose or that can block doors }
   tpCountsForAll = [tpOnImplicit, tpOn, tpIn, tpCarried]; { things that should be included when listing 'all', as in "take all" }
   tpSeparate = [tpAroundImplicit, tpAtImplicit, tpAt, tpInstalledIn, tpIn, tpCarried]; { affects how things are pushed around }
   tpContained = [tpInstalledIn, tpIn, tpEmbedded]; { things that shouldn't be aware of goings-on outside, if the parent is closed; count towards InsideSizeManifest }
   tpOpening = [tpSurfaceOpening, tpDirectionalOpening];
   tpArguablyOn = [tpPartOfImplicit, tpAmbiguousPartOfImplicit, tpAroundImplicit, tpAtImplicit, tpOnImplicit, tpPlantedInImplicit, tpAt, tpOn, tpPlantedIn, tpDirectionalPath]; { things that the user can refer to as being "on" then parent }
   tpArguablyOf = [tpPartOfImplicit, tpAmbiguousPartOfImplicit, tpOnImplicit, tpPlantedInImplicit, tpDirectionalOpening, tpSurfaceOpening, tpAt, tpPlantedIn, tpInstalledIn, tpEmbedded, tpCarried]; // positions for children that should by found by "find child of parent"
   tpArguablyInside = [tpPlantedInImplicit, tpPlantedIn, tpInstalledIn, tpIn, tpEmbedded, tpDirectionalOpening, tpSurfaceOpening]; { things that the user can refer to as being "in" their parent }
   tpOutside = [tpPlantedInImplicit, tpOn, tpPlantedIn, tpCarried]; { things that count towards OutsideSizeManifest }
   tpSurface = [tpPlantedInImplicit, tpOn, tpPlantedIn]; { things that count towards SurfaceSizeManifest }
   tpDeferNavigationToParent = [tpPartOfImplicit, tpAmbiguousPartOfImplicit, tpAroundImplicit, tpAtImplicit, tpOnImplicit, tpPlantedInImplicit, tpDirectionalPath, tpAt, tpOn, tpInstalledIn]; // see below
   tpTransitivePositions = [tpAroundImplicit, tpAtImplicit, tpOnImplicit, tpAt, tpOn, tpIn, tpCarried]; // see below

   { tpDeferNavigationToParent: If a thing A is tpOn a thing B and
     tries to navigate, then we defer to B to tell A where to go. If a
     thing A is tpIn a thing B, then we don't, because you first have
     to get out of B.

     tpTransitivePositions: If a thing A is tpOn a thing B that is
     tpInstalledIn a thing C that is tpIn a thing D, then A is on B
     and in D, but it's not installed in C. tpOn and tpIn are thus
     considered "transitive", while tpInstalledIn is not.

     It's possible that the union of tpDeferNavigationToParent and
     tpTransitivePositions should include all TThingPosition values.
     Right now this isn't true, so e.g. if you're on something that's
     planted in something else, you won't be able to navigate using
     cardinal directions (tpPlantedInImplicit is not in
     tpDeferNavigationToParent), but you will just be told it's
     because you're on the planted thing, not because you're planted
     in something else (since tpPlantedInImplicit isn't in
     tpTransitivePositions either). }