TAction class | action.t[3066], en_us.t[8421]

Transitive Action class - this is an action that takes a direct object.

For simplicity, this object is its own object resolver - we really don't need a separate resolver object because we have only one object list for this verb. (In contrast, an action with both a direct and indirect object might need separate resolution rules for the two objects, and hence would need separate resolver objects for the two.)

The advantage of implementing the Resolver behavior in this object, rather than using a separate object, is that it's less trouble to override object resolution rules - simply override the resolver methods in the subclass where you define the grammar rule for the action.

Modified in en_us.t[8421]:
English-specific additions for single-object verbs.

`class TAction : Action Resolver`

Superclass Tree (in declaration order)

`TAction`
`Action`
`BasicProd`
`object`
`Resolver`
`object`

Subclass Tree

`TAction`
`AttackAction`
`predicate(Attack)`
`BoardAction`
`predicate(Board)`
`BreakAction`
`predicate(Break)`
`BurnAction`
`predicate(Burn)`
`CleanAction`
`predicate(Clean)`
`ClimbAction`
`predicate(Climb)`
`ClimbDownAction`
`predicate(ClimbDown)`
`predicate(ClimbDownWhat)`
`ClimbUpAction`
`predicate(ClimbUp)`
`predicate(ClimbUpWhat)`
`CloseAction`
`predicate(Close)`
`ConsultAction`
`predicate(Consult)`
`CutAction`
`DetachAction`
`predicate(Detach)`
`DigAction`
`predicate(Dig)`
`DoffAction`
`predicate(Doff)`
`DrinkAction`
`predicate(Drink)`
`DropAction`
`predicate(Drop)`
`EatAction`
`predicate(Eat)`
`EnterAction`
`predicate(Enter)`
`ExamineAction`
`predicate(Examine)`
`ExtinguishAction`
`predicate(Extinguish)`
`FastenAction`
`predicate(Fasten)`
`FeelAction`
`predicate(Feel)`
`FlipAction`
`predicate(Flip)`
`FollowAction`
`predicate(Follow)`
`GetOffOfAction`
`predicate(GetOffOf)`
`GetOutOfAction`
`predicate(GetOutOf)`
`GoThroughAction`
`predicate(GoThrough)`
`JumpOffAction`
`predicate(JumpOff)`
`JumpOverAction`
`predicate(JumpOver)`
`KissAction`
`predicate(Kiss)`
`LieOnAction`
`predicate(LieOn)`
`LightAction`
`predicate(Light)`
`ListenToAction`
`predicate(ListenTo)`
`LiteralTAction`
`EnterOnAction`
`predicate(EnterOn)`
`predicate(EnterOnWhat)`
`SetToAction`
`predicate(SetTo)`
`TurnToAction`
`predicate(TurnTo)`
`TypeLiteralOnAction`
`predicate(TypeLiteralOn)`
`predicate(TypeLiteralOnWhat)`
`LockAction`
`predicate(Lock)`
`LookBehindAction`
`predicate(LookBehind)`
`LookInAction`
`predicate(LookIn)`
`LookThroughAction`
`predicate(LookThrough)`
`LookUnderAction`
`predicate(LookUnder)`
`MoveAction`
`predicate(Move)`
`OpenAction`
`predicate(Open)`
`PlugInAction`
`predicate(PlugIn)`
`PourAction`
`predicate(Pour)`
`PullAction`
`predicate(Pull)`
`PushAction`
`predicate(Push)`
`PushTravelAction`
`PushTravelDirAction`
`predicate(PushTravelDir)`
`PushAftAction`
`PushDownAction`
`PushEastAction`
`PushForeAction`
`PushInAction`
`PushNorthAction`
`PushNortheastAction`
`PushNorthwestAction`
`PushOutAction`
`PushPortAction`
`PushSouthAction`
`PushSoutheastAction`
`PushSouthwestAction`
`PushStarboardAction`
`PushUpAction`
`PushWestAction`
`PushTravelViaIobjAction`
`PushTravelClimbDownAction`
`predicate(PushTravelClimbDown)`
`PushTravelClimbUpAction`
`predicate(PushTravelClimbUp)`
`PushTravelEnterAction`
`predicate(PushTravelEnter)`
`PushTravelGetOutOfAction`
`predicate(PushTravelGetOutOf)`
`PushTravelThroughAction`
`predicate(PushTravelThrough)`
`ReadAction`
`predicate(Read)`
`RemoveAction`
`predicate(Remove)`
`ScrewAction`
`predicate(Screw)`
`SearchAction`
`predicate(Search)`
`SetAction`
`predicate(Set)`
`SitOnAction`
`predicate(SitOn)`
`SmellAction`
`predicate(Smell)`
`StandOnAction`
`predicate(StandOn)`
`StrikeAction`
`predicate(Strike)`
`SwitchAction`
`predicate(Switch)`
`TakeAction`
`predicate(Take)`
`TalkToAction`
`predicate(TalkTo)`
`predicate(TalkToWhat)`
`TasteAction`
`predicate(Taste)`
`ThrowAction`
`predicate(Throw)`
`ThrowDirAction`
`predicate(ThrowDir)`
`predicate(ThrowDirDown)`
`TIAction`
`AttachToAction`
`predicate(AttachTo)`
`predicate(AttachToWhat)`
`AttackWithAction`
`predicate(AttackWith)`
`BurnWithAction`
`predicate(BurnWith)`
`CleanWithAction`
`predicate(CleanWith)`
`CutWithAction`
`predicate(CutWith)`
`predicate(CutWithWhat)`
`DetachFromAction`
`predicate(DetachFrom)`
`DigWithAction`
`predicate(DigWith)`
`FastenToAction`
`predicate(FastenTo)`
`GiveToAction`
`predicate(GiveTo)`
`predicate(GiveToType2)`
`predicate(GiveToWhom)`
`LockWithAction`
`predicate(LockWith)`
`MoveToAction`
`predicate(MoveTo)`
`MoveWithAction`
`predicate(MoveWith)`
`PlugIntoAction`
`predicate(PlugInto)`
`predicate(PlugIntoWhat)`
`PourIntoAction`
`predicate(PourInto)`
`PourOntoAction`
`predicate(PourOnto)`
`PushTravelViaIobjAction`
`PushTravelClimbDownAction`
`predicate(PushTravelClimbDown)`
`PushTravelClimbUpAction`
`predicate(PushTravelClimbUp)`
`PushTravelEnterAction`
`predicate(PushTravelEnter)`
`PushTravelGetOutOfAction`
`predicate(PushTravelGetOutOf)`
`PushTravelThroughAction`
`predicate(PushTravelThrough)`
`PutBehindAction`
`predicate(PutBehind)`
`PutInAction`
`predicate(PutIn)`
`predicate(PutInWhat)`
`PutOnAction`
`predicate(PutOn)`
`PutUnderAction`
`predicate(PutUnder)`
`ScrewWithAction`
`predicate(ScrewWith)`
`ShowToAction`
`predicate(ShowTo)`
`predicate(ShowToType2)`
`predicate(ShowToWhom)`
`TakeFromAction`
`predicate(TakeFrom)`
`ThrowAtAction`
`predicate(ThrowAt)`
`ThrowToAction`
`predicate(ThrowTo)`
`predicate(ThrowToType2)`
`TurnWithAction`
`predicate(TurnWith)`
`UnfastenFromAction`
`predicate(UnfastenFrom)`
`UnlockWithAction`
`predicate(UnlockWith)`
`UnplugFromAction`
`predicate(UnplugFrom)`
`UnscrewWithAction`
`predicate(UnscrewWith)`
`TopicTAction`
`AskVagueAction`
`predicate(AskVague)`
`predicate(TellVague)`
`ConsultAboutAction`
`predicate(ConsultAbout)`
`predicate(ConsultWhatAbout)`
`ConvTopicTAction`
`AskAboutAction`
`predicate(AskAbout)`
`predicate(AskAboutImplicit)`
`predicate(AskAboutWhat)`
`AskForAction`
`predicate(AskFor)`
`predicate(AskWhomFor)`
`TellAboutAction`
`predicate(TellAbout)`
`predicate(TellAboutImplicit)`
`predicate(TellAboutWhat)`
`TellVagueAction`
`TravelViaAction`
`EnTravelVia`
`TurnAction`
`predicate(Turn)`
`TurnOffAction`
`predicate(TurnOff)`
`TurnOnAction`
`predicate(TurnOn)`
`TypeOnAction`
`predicate(TypeOn)`
`UnfastenAction`
`predicate(Unfasten)`
`UnlockAction`
`predicate(Unlock)`
`UnplugAction`
`predicate(Unplug)`
`UnscrewAction`
`predicate(Unscrew)`
`WearAction`
`predicate(Wear)`

Global Objects

(none)

Summary of Properties

`actionAllowsAll actionDobjProp actor_ askDobjResponseProd checkDobjProp dobjCur_ dobjInfoCur_ dobjList_ dobjMatch dobjResolver_ issuer_ preCondDobjProp predicateNounPhrases remapDobjProp verDobjProp whichMessageObject`

Inherited from `Action` :
`actionTime afterActionMainList beforeAfterObjs defaultForRecursion extraMessageParams implicitMsg includeInUndo isImplicit isRepeatable iterationCanceled originalAction parentAction preCond pronounOverride remappedFrom showDefaultReports synthParamID verbFlags verifiedOkay`

Inherited from `BasicProd` :
`firstTokenIndex isSpecialResponseMatch lastTokenIndex`

Inherited from `Resolver` :
`action_ equivs_ isGlobalScope isSubResolver scope_ whichObject`

Summary of Methods

`adjustDefaultObjectPrep announceAllDefaultObjects announceDefaultObject canDobjResolveTo checkAction checkRemapping construct createDobjResolver createForMissingDobj createForRetry doActionMain execAction filterAmbiguousDobj filterPluralDobj getAllDobj getCurrentObjects getDefaultDobj getDobj getDobjCount getDobjFlags getDobjInfo getDobjResolver getDobjTokens getDobjWords getMatchForRole getMessageParam getObjectForRole getObjResponseProd getPreCondDescList getPreCondPropForRole getQuestionInf getRemapPropForRole getResolvedDobjList getResolvedObjList getResolveInfo getRoleFromIndex getVerbPhrase getVerbPhrase1 getVerifyPropForRole initForMissingDobj initResolver initTentative resetAction resolvedObjectsInScope resolveNouns retryWithAmbiguousDobj retryWithMissingDobj setCurrentObjects setObjectMatches setResolvedDobj setResolvedObjects testRetryDefaultDobj verifyAction whatObj`

Inherited from `Action` :
`actionOfKind addBeforeAfterObj afterAction afterActionMain announceActionObject beforeAction beforeActionMain cacheMultiObjectAnnouncements callAfterActionMain callCatchAllProp callPreConditions callVerifyPreCond callVerifyProp cancelIteration checkPreConditions combineRemappedVerifyResults createActionFrom createActionInstance createTopicQualifierResolver doAction doActionOnce filterAmbiguousWithVerify filterFacets filterPluralWithVerify finishResolveList getAnaphoricBinding getDefaultWithVerify getEnteredVerbPhrase getImplicitPhrase getInfPhrase getNotifyTable getObjPreCondDescList getObjPreConditions getOriginalAction getOrigTokenList getOtherObjectRole getParticiplePhrase getPredicate getPronounOverride getRemappedFrom getSimpleSynonymRemap getSortedVerifyResults isConversational isNestedIn isPartOf isRemapped makeResolveInfo makeResolveInfoList maybeAnnounceDefaultObject maybeAnnounceImplicit maybeAnnounceMultiObject noMatch notifyBeforeAfter objListPronoun preAnnounceActionObject recalcSenseContext repeatAction resolveAction runBeforeNotifiers saveActionForAgain setImplicit setMessageParam setMessageParams setNested setOriginalAction setPronounOverride setRemapped spPrefix spSuffix synthMessageParam verifyHandlersExist whatTranslate withVerifyResults zeroActionTime`

Inherited from `BasicProd` :
`canResolveTo getOrigText setOrigTokenList`

Inherited from `Resolver` :
`allowAll cacheScopeList filterAll filterAmbiguousEquivalents filterAmbiguousNounPhrase filterPluralPhrase filterPossRank getAction getAll getAllDefaults getDefaultObject getPossessiveResolver getPronounDefault getQualifierResolver getRawPronounAntecedent getReflexiveBinding getScopeList getTargetActor matchName objInScope resetResolver resolvePronounAntecedent resolveUnknownNounPhrase selectIndefinite withGlobals`

Properties

`actionAllowsAll` | `action.t[3669]`

Does this action allow "all" to be used in noun phrases? By default, we allow it or not according to a gameMain property.

Note that the inventory management verbs (TAKE, TAKE FROM, DROP, PUT IN, PUT ON) override this to allow "all" to be used, so disallowing "all" here (or via gameMain) won't disable "all" for those verbs.

`actionDobjProp` | `action.t[3620]`

no description available

`actor_`OVERRIDDEN | `action.t[3786]`

target actor

`askDobjResponseProd` | `action.t[3221]`

The root production to use to parse missing direct object responses. By default, this is nounList, but individual actions can override this as appropriate.

Note that language modules might want to override this to allow for special responses. For example, in English, some verbs might want to override this with a specialized production that allows the appropriate preposition in the response.

`checkDobjProp` | `action.t[3619]`

no description available

`dobjCur_` | `action.t[3745]`

The resolved direct object on which we're currently executing the command. To execute the command, we iterate through the direct object list, calling the execution sequence for each object in the list. We set this to the current object in each iteration.

`dobjInfoCur_` | `action.t[3748]`

the full ResolveInfo associated with dobjCur_

`dobjList_` | `action.t[3737]`

my resolved list of direct objects

`dobjMatch` | `action.t[3734]`

the predicate must assign the direct object production tree here

`dobjResolver_` | `action.t[3751]`

my cached direct object resolver

`issuer_`OVERRIDDEN | `action.t[3783]`

issuing actor

`preCondDobjProp` | `action.t[3617]`

no description available

`predicateNounPhrases` OVERRIDDEN | `action.t[3269]`

a transitive action has one noun phrase: the direct object

`remapDobjProp` | `action.t[3618]`

no description available

`verDobjProp` | `action.t[3616]`

The direct object preconditions, verifier, remapper, check, and action methods for this action. Each concrete action must define these appropriately. By convention, the methods are named like so:

preconditions: preCondDobjAction
verifier: verDobjAction
remap: remapDobjAction
check: checkDobjAction
action: actionDobjAction

where the 'Action' suffix is replaced by the name of the action. The DefineTAction macro applies this convention, so in most cases library and game authors will never have to create all of those property names manually.

`whichMessageObject` OVERRIDDEN | `action.t[3795]`

By default, our direct object plays the direct object role in generated messages. Subclasses can override this if the resolved object is to play a different role. Note that this only affects generated messages; for parsing purposes, our object is always in the DirectObject role.

Methods

`adjustDefaultObjectPrep (prep, obj)` | `en_us.t[8466]`

Adjust the preposition. In some cases, the verb will want to vary the preposition according to the object. This method can return a custom preposition in place of the one in the verbPhrase. By default, we just use the fixed preposition from the verbPhrase, which is passed in to us in 'prep'.

`announceAllDefaultObjects (allResolved)`OVERRIDDEN | `en_us.t[8469]`

announce all defaulted objects

`announceDefaultObject (obj, whichObj, resolvedAllObjects)`OVERRIDDEN | `en_us.t[8434]`

announce a default object used with this action

`canDobjResolveTo (obj)` | `action.t[3241]`

Can the direct object potentially resolve to the given simulation object? This only determines if the object is a *syntactic* match, meaning that it can match at a vocabulary and grammar level. This doesn't test it for logicalness or check that it's an otherwise valid resolution.

`checkAction ( )`OVERRIDDEN | `action.t[3555]`

Check the command.

For a single-object transitive action, this runs the catch-all 'check' properties (the dobjFor(Default) and dobjFor(All) 'check' methods) on the direct object, then calls the individual 'check' routine for this specific action.

`checkRemapping ( )`OVERRIDDEN | `action.t[3531]`

Check for remapping

`construct ( )`OVERRIDDEN | `action.t[3067]`

no description available

`createDobjResolver (issuingActor, targetActor)` | `action.t[3651]`

Create a resolver for the direct object. By default, we are our own resolver. Some actions might want to override this to create and return a specialized resolver instance if special resolution rules are needed.

`createForMissingDobj (orig, asker)` | `action.t[3182]`

Create an instance of this action for retrying a given single-object action with a missing direct object.

`createForRetry (orig)` | `action.t[3085]`

Create an action for retrying an original action with changes.

`doActionMain ( )` | `action.t[3431]`

Execute the action. We'll run through the execution sequence once for each resolved direct object.

`execAction ( )`OVERRIDDEN | `action.t[3584]`

Execute the command.

`filterAmbiguousDobj (lst, requiredNum, np)` | `action.t[3683]`

filter an ambiguous direct object noun phrase

`filterPluralDobj (lst, np)` | `action.t[3692]`

filter a plural phrase

`getAllDobj (actor, scopeList)` | `action.t[3677]`

Resolve 'all' for the direct object, given a list of everything in scope. By default, we'll simply return everything in scope; some actions might want to override this to return a more specific list of objects suitable for 'all'.

`getCurrentObjects ( )`OVERRIDDEN | `action.t[3484]`

Get the list of active objects. We have only a direct object, so we'll return a list with the current direct object.

`getDefaultDobj (np, resolver)` | `action.t[3700]`

get the default direct object

`getDobj ( )` | `action.t[3708]`

get the current direct object of the command

`getDobjCount ( )` | `action.t[3717]`

get the number of direct objects

`getDobjFlags ( )` | `action.t[3714]`

get the object resolution flags for the direct object

`getDobjInfo ( )` | `action.t[3711]`

get the full ResolveInfo associated with the current direct object

`getDobjResolver (issuingActor, targetActor, reset)` | `action.t[3631]`

Get my direct object resolver. If I don't already have one, create one and cache it; if I've already cached one, return it. Note that we cache the resolver because it can sometimes take a bit of work to set one up (the scope list can in some cases be complicated to calculate). We use the resolver only during the object resolution phase; since game state can't change during this phase, it's safe to keep a cached copy.

`getDobjTokens ( )` | `action.t[3720]`

get the original token list of the current direct object phrase

`getDobjWords ( )` | `action.t[3727]`

get the original words (as a list of strings) of the current dobj

`getMatchForRole (role)`OVERRIDDEN | `action.t[3286]`

get the match tree for the noun phrase in the given role

`getMessageParam (objName)`OVERRIDDEN | `action.t[3413]`

Get a message parameter object for the action. We define 'dobj' as the direct object, in addition to any inherited targets.

`getObjectForRole (role)`OVERRIDDEN | `action.t[3279]`

get the resolved object in a given role

`getObjResponseProd (resolver)`OVERRIDDEN | `action.t[3224]`

get the missing object response production for a given role

`getPreCondDescList ( )`OVERRIDDEN | `action.t[3469]`

get the precondition descriptor list for the action

`getPreCondPropForRole (role)`OVERRIDDEN | `action.t[3299]`

get the 'preCond' property for a given object role

`getQuestionInf (which)`OVERRIDDEN | `en_us.t[8476]`

show the verb's basic infinitive form for an interrogative

`getRemapPropForRole (role)`OVERRIDDEN | `action.t[3305]`

get the 'remap' property for a given object role

`getResolvedDobjList ( )` | `action.t[3351]`

get the list of resolved direct objects

`getResolvedObjList (which)`OVERRIDDEN | `action.t[3344]`

get the list of resolved objects in the given role

`getResolveInfo (obj, oldRole)`OVERRIDDEN | `action.t[3311]`

get the ResolveInfo for the given object

`getRoleFromIndex (idx)`OVERRIDDEN | `action.t[3272]`

get the role of an object

`getVerbPhrase (inf, ctx)`OVERRIDDEN | `en_us.t[8492]`

get the verb phrase in infinitive or participle form

`getVerbPhrase1 (inf, vp, dobjText, dobjIsPronoun)` | `en_us.t[8534]`

Given the text of the direct object phrase, build the verb phrase for a one-object verb. This is a class method that can be used by other kinds of verbs (i.e., non-TActions) that use phrasing like a single object.

'inf' is a flag indicating whether to use the infinitive form (true) or the present participle form (nil); 'vp' is the verbPhrase string; 'dobjText' is the direct object phrase's text; and 'dobjIsPronoun' is true if the dobj text is rendered as a pronoun.

`getVerifyPropForRole (role)`OVERRIDDEN | `action.t[3293]`

get the 'verify' property for a given object role

`initForMissingDobj (orig)` | `action.t[3209]`

Initialize this action in preparation for retrying with a missing direct object. This routine must copy any phrases from the original action that have already been resolved. This base TAction implementation obviously can't have anything pre-resolved in the original, since the original must simply be an IAction. Subclasses must override as appropriate for the kinds of base actions from which they can be retried.

`initResolver (issuingActor, targetActor)` | `action.t[3769]`

Initialize me as a resolver.

`initTentative (issuingActor, targetActor, whichObj)`OVERRIDDEN | `action.t[3520]`

initialize tentative resolutions for other noun phrases

`resetAction ( )`OVERRIDDEN | `action.t[3073]`

inherit only the Action constructor

`resolvedObjectsInScope ( )`OVERRIDDEN | `action.t[3402]`

check that the resolved objects are in scope

`resolveNouns (issuingActor, targetActor, results)` | `action.t[3253]`

Resolve objects. This is called at the start of command execution to resolve noun phrases in the command to specific objects.

`retryWithAmbiguousDobj (orig, objs, asker, objPhrase)` | `action.t[3138]`

Retry an action as a single-object action with an ambiguous direct object. We'll ask which of the given possible objects is intended.

`retryWithMissingDobj (orig, asker)` | `action.t[3127]`

Retry an intransitive action as a single-object action. We'll obtain a indirect object using the normal means (first looking for a default, then prompting the player if we can't find a suitable default). 'orig' is the original zero-object action.

This routine terminates with 'exit' if it doesn't throw some other error.

`setCurrentObjects (lst)`OVERRIDDEN | `action.t[3490]`

set the current objects

`setObjectMatches (dobj)`OVERRIDDEN | `action.t[3389]`

manually set the unresolved object noun phrase match trees

`setResolvedDobj (dobj)` | `action.t[3368]`

set the resolved direct object

`setResolvedObjects (dobj)`OVERRIDDEN | `action.t[3361]`

manually set the resolved objects - we'll set the direct object

`testRetryDefaultDobj (orig)` | `action.t[3164]`

Test to see if askForDobj() would find a default direct object. Returns true if there's a default, nil if not. If this returns true, then askForDobj() will simply take the default and proceed; otherwise, it will have to actually ask the user for the missing information.

`verifyAction ( )`OVERRIDDEN | `action.t[3499]`

Verify the action.

`whatObj (which)`OVERRIDDEN | `en_us.t[8423]`

return an interrogative word for an object of the action

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3