Documentation ¶
Overview ¶
Package tunaq contains a CLI-driven engine for getting commands and advancing the game state continuously until the user quits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine contains the things needed to run a game from an interactive shell attached to an input stream and an output stream.
func New ¶
func New(inputStream io.Reader, outputStream io.Writer, worldFilePath string, forceDirectInput bool) (*Engine, error)
New creates a new engine ready to operate on the given input and output streams. It will immediately open a buffered reader on the input stream and a buffered writer on the output stream.
If nil is given for the input stream, a bufio.Reader is opened on stdin. If nil is given for the output stream, a bufio.Writer is opened on stdout.
func (*Engine) Close ¶
Close closes all resources associated with the Engine, including any readline-related resources created for interactive mode.
func (*Engine) RunUntilQuit ¶
RunUntilQuit begins reading commands from the streams and applying them to the game until the QUIT command is received.
startCommands, if non nil, is commands to run as soon as it starts.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
tqi
Tqi starts an interactive TunaQuest engine session.
|
Tqi starts an interactive TunaQuest engine session. |
internal
|
|
command
Package command defines game command data types and handles parsing of commands from input sources.
|
Package command defines game command data types and handles parsing of commands from input sources. |
game
Package game implements game state and advancement.
|
Package game implements game state and advancement. |
input
Package input contains identifiers used in getting TunaQuest command input from CLI or other sources of input.
|
Package input contains identifiers used in getting TunaQuest command input from CLI or other sources of input. |
tqw
Package tqw has functions for loading game data using the TQW (TunaQuest Worlds) game data file format, a TOML-based format that is used to define game worlds for the engine to run.
|
Package tqw has functions for loading game data using the TQW (TunaQuest Worlds) game data file format, a TOML-based format that is used to define game worlds for the engine to run. |
version
Package version contains information on the current version of the program.
|
Package version contains information on the current version of the program. |
Package tunascript is an interpretation engine for reading tunascript code and applying it to a running world.
|
Package tunascript is an interpretation engine for reading tunascript code and applying it to a running world. |
fe
Package fe contains the frontend for analyzing TunaScript code.
|
Package fe contains the frontend for analyzing TunaScript code. |
fe/fetoken
Package fetoken contains the token classes used by the frontend of TunaScript.
|
Package fetoken contains the token classes used by the frontend of TunaScript. |
fetmpl
Package fetmpl contains the frontend for analyzing TunaQuest Template code.
|
Package fetmpl contains the frontend for analyzing TunaQuest Template code. |
fetmpl/fetmpltoken
Package fetmpltoken contains the token classes used by the frontend of TunaQuest Template.
|
Package fetmpltoken contains the token classes used by the frontend of TunaQuest Template. |
syntax
Package syntax creates abstract TunaScript and TunaQuest template language constructs from parse trees passed to it from generated frontends.
|
Package syntax creates abstract TunaScript and TunaQuest template language constructs from parse trees passed to it from generated frontends. |