FinishOptionclassmisc.t[1164]

Finish Option class. This is the base class for the abstract objects representing options offered by finishGame.

class FinishOption :   object

Superclass Tree   (in declaration order)

FinishOption
        object

Subclass Tree  

(none)

Global Objects  

finishOptionAmusing  finishOptionCredits  finishOptionFullScore  finishOptionQuit  finishOptionRestart  finishOptionRestore  finishOptionScore  finishOptionUndo 

Summary of Properties  

desc  listed  responseChar  responseKeyword  showScoreInFinish 

Summary of Methods  

doOption  responseMatches 

Properties  

descmisc.t[1172]

The description, as displayed in the list of options. For the default English messages, this is expected to be a verb phrase in infinitive form, and should show the keyword accepted as a response in all capitals: "RESTART", "see some AMUSING things to do", "show CREDITS".

listedmisc.t[1183]
By default, the item is listed. If you want to create an invisible option that's accepted but which isn't listed in the prompt, just set this to nil. Invisible options are sometimes useful when the output of one option mentions another option; for example, the CREDITS message might mention a LICENSE command for displaying the license, so you want to make that command available without cluttering the prompt with it.

responseCharmisc.t[1193]
a single character we accept as an alternative to our full response keyword, or nil if we don't accept a single-character response

responseKeywordmisc.t[1186]
our response keyword

showScoreInFinishmisc.t[1236]
Flag: show the score with the end-of-game announcement. If any option in the list of finishing options has this flag set, we'll show the score using the same message that the SCORE command uses.

Methods  

doOption ( )misc.t[1224]

Carry out the option. This is called when the player enters a response that matches this option. This routine must perform the action of the option, then return true to indicate that we should ask for another option, or nil to indicate that the finishGame() routine should simply return.

responseMatches (response)misc.t[1203]
Match a response string to this option. Returns true if the string matches our response, nil otherwise. By default, we'll return true if the string exactly matches responseKeyword or exactly matches our responseChar (if that's non-nil), but this can be overridden to match other strings if desired. By default, we'll match the response without regard to case.

Adv3Lite Library Reference Manual
Generated on 03/07/2024 from adv3Lite version 2.1