LogicalVerifyResultclass
Verification result - command is logical and allowed.
This can provide additional information ranking the likelihood of the command intepretation, which can be useful to distinguish among logical but not equally likely possibilities. For example, if the command is “take book,” and the actor has a book inside his or her backpack, and there is also a book on a table in the actor’s location, it would make sense to take either book, but the game might prefer to take the book on the table because it’s not already being carried. The likelihood level can be used to rank these alternatives: if the object is being carried indirectly, a lower likelihood ranking would be returned than if the object were not already somewhere in the actor’s inventory.
class
LogicalVerifyResult
:
VerifyResult
Superclass Tree (in declaration order)
LogicalVerifyResult
VerifyResult
MessageResult
` object`
Subclass Tree
(none)
Global Objects
Summary of Properties
keyVal
likelihood
listOrder
resultRank
Inherited from VerifyResult
:
allowAction
excludePluralMatches
Inherited from MessageResult
:
messageProp_
messageText_
Summary of Methods
compareTo
construct
identicalTo
isWorseThan
shouldInsertBefore
Inherited from MessageResult
:
resolveMessageText
setMessage
showMessage
Properties
keyVal
my key value, to distinguish among different results with the same likelihood ranking
likelihood
The likelihood of the command - the higher the number, the more likely. We use 100 as the default, so that there’s plenty of room for specific rankings above or below the default. Particular actions might want to rank likelihoods based on action-specific factors.
listOrder
Our list ordering. This establishes how we are entered into the master results list relative to other ‘logical’ results. Results are entered into the master list in ascending list order, so a lower order number means an earlier place in the list.
The list ordering is more important than the likelihood ranking. Suppose we have two items: one is at list order 10 and has likelihood 100, and the other is at list order 20 and has likelihood 50. The order of the likelihoods stored in the list will be (100, 50). This is inverted from the normal ordering, which would put the worst item first.
The point of this ordering is to allow for logical results with higher or lower importances in establishing the likelihood. The library uses the following list order values:
100 - the default ranking. This is used in most cases.
150 - secondary ranking. This is used for rankings that aren’t of great importance but which can be useful to distinguish objects in cases where no more important rankings are present. The library uses this for precondition verification rankings.
resultRank
OVERRIDDEN
result rank - we’re the most approving kind of result
Methods
compareTo (other)
OVERRIDDEN
compare to another result
construct (likelihoodRank, key, ord)
OVERRIDDEN
no description available
identicalTo (other)
OVERRIDDEN
determine if I’m identical to another result
isWorseThan (other)
OVERRIDDEN
am I worse than the other result?
shouldInsertBefore (other)
OVERRIDDEN
determine if I go in a result list before the given result
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3