FinishOptionclass | misc.t[1072]

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

`desc` | `misc.t[1080]`

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".

`listed` | `misc.t[1091]`

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.

`responseChar` | `misc.t[1101]`

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

`responseKeyword` | `misc.t[1094]`

our response keyword

`showScoreInFinish` | `misc.t[1144]`

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[1132]`

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[1111]`

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 01/03/2024 from adv3Lite version 1.6.2