Standard inventory lister for actors - this will work for the player character and NPC's as well. This lister uses a "divided" format, which segregates the listing into items being carried and items being worn. We'll combine the two lists into a single sentence if the overall list is short, otherwise we'll show two separate sentences for readability.
actorInventoryLister : DividedInventoryLister
Superclass Tree (in declaration order)
Summary of Properties
Summary of Methods
Count the noun phrases in a string. We'll count the number of elements in the list as indicated by commas and semicolons. This might not be a perfect count of the actual number of noun phrases, since we could have commas setting off some other kind of clauses, but it nonetheless will give us a good estimate of the overall complexity of the text, which is what we're really after. The point is that we want to break up the listings if they're long, but combine them into a single sentence if they're short.
showCombinedInventoryList (parent, carrying, wearing)OVERRIDDEN
Show the combined inventory listing, putting together the raw lists of the items being carried and the items being worn.
we're carrying nothing but wearing some items
Once we've made up our mind about the format, we'll call one of these methods to show the final sentence. These are all separate methods so that the individual formats can be easily tweaked without overriding the whole combined-inventory-listing method.
showInventoryLongLists (parent, carrying, wearing)
short lists - combine carried and worn in a single sentence
showInventoryShortLists (parent, carrying, wearing)
we have only carried items to report
showListContentsPrefixTall (itemCount, pov, parent)OVERRIDDEN
showListPrefixTall (itemCount, pov, parent)OVERRIDDEN
For 'tall' listings, we'll use the standard listing style, so we need to provide the framing messages for the tall-mode listing.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3