TActionclass
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/Resolver.html)
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
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
no description available
actor_
OVERRIDDEN
target actor
askDobjResponseProd
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
no description available
dobjCur_
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_
the full ResolveInfo associated with dobjCur_
dobjList_
my resolved list of direct objects
dobjMatch
the predicate must assign the direct object production tree here
dobjResolver_
my cached direct object resolver
issuer_
OVERRIDDEN
issuing actor
preCondDobjProp
no description available
predicateNounPhrases
OVERRIDDEN
a transitive action has one noun phrase: the direct object
remapDobjProp
no description available
verDobjProp
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
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)
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
announce all defaulted objects
announceDefaultObject (obj, whichObj, resolvedAllObjects)
OVERRIDDEN
announce a default object used with this action
canDobjResolveTo (obj)
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
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
Check for remapping
construct ( )
OVERRIDDEN
no description available
createDobjResolver (issuingActor, targetActor)
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)
Create an instance of this action for retrying a given single-object action with a missing direct object.
createForRetry (orig)
Create an action for retrying an original action with changes.
doActionMain ( )
Execute the action. We’ll run through the execution sequence once for each resolved direct object.
execAction ( )
OVERRIDDEN
Execute the command.
filterAmbiguousDobj (lst, requiredNum, np)
filter an ambiguous direct object noun phrase
filterPluralDobj (lst, np)
filter a plural phrase
getAllDobj (actor, scopeList)
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
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)
get the default direct object
getDobj ( )
get the current direct object of the command
getDobjCount ( )
get the number of direct objects
getDobjFlags ( )
get the object resolution flags for the direct object
getDobjInfo ( )
get the full ResolveInfo associated with the current direct object
getDobjResolver (issuingActor, targetActor, reset)
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 ( )
get the original token list of the current direct object phrase
getDobjWords ( )
get the original words (as a list of strings) of the current dobj
getMatchForRole (role)
OVERRIDDEN
get the match tree for the noun phrase in the given role
getMessageParam (objName)
OVERRIDDEN
Get a message parameter object for the action. We define ‘dobj’ as the direct object, in addition to any inherited targets.
getObjectForRole (role)
OVERRIDDEN
get the resolved object in a given role
getObjResponseProd (resolver)
OVERRIDDEN
get the missing object response production for a given role
getPreCondDescList ( )
OVERRIDDEN
get the precondition descriptor list for the action
getPreCondPropForRole (role)
OVERRIDDEN
get the ‘preCond’ property for a given object role
getQuestionInf (which)
OVERRIDDEN
show the verb’s basic infinitive form for an interrogative
getRemapPropForRole (role)
OVERRIDDEN
get the ‘remap’ property for a given object role
getResolvedDobjList ( )
get the list of resolved direct objects
getResolvedObjList (which)
OVERRIDDEN
get the list of resolved objects in the given role
getResolveInfo (obj, oldRole)
OVERRIDDEN
get the ResolveInfo for the given object
getRoleFromIndex (idx)
OVERRIDDEN
get the role of an object
getVerbPhrase (inf, ctx)
OVERRIDDEN
get the verb phrase in infinitive or participle form
getVerbPhrase1 (inf, vp, dobjText, dobjIsPronoun)
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
get the ‘verify’ property for a given object role
initForMissingDobj (orig)
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)
Initialize me as a resolver.
initTentative (issuingActor, targetActor, whichObj)
OVERRIDDEN
initialize tentative resolutions for other noun phrases
resetAction ( )
OVERRIDDEN
inherit only the Action constructor
resolvedObjectsInScope ( )
OVERRIDDEN
check that the resolved objects are in scope
resolveNouns (issuingActor, targetActor, results)
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)
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)
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
set the current objects
setObjectMatches (dobj)
OVERRIDDEN
manually set the unresolved object noun phrase match trees
setResolvedDobj (dobj)
set the resolved direct object
setResolvedObjects (dobj)
OVERRIDDEN
manually set the resolved objects - we’ll set the direct object
testRetryDefaultDobj (orig)
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
Verify the action.
whatObj (which)
OVERRIDDEN
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