game

package
v0.24.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Overview

System commands to manage a running game ( save, load, etc ).

Index

Constants

This section is empty.

Variables

View Source
var Z_Types = typeinfo.TypeSet{
	Name: "game",
	Comment: []string{
		"System commands to manage a running game ( save, load, etc ).",
	},

	Flow:       z_flow_list,
	Signatures: z_signatures,
}

package listing of type data

View Source
var Zt_LoadGame typeinfo.Flow

load_game, a type of flow.

View Source
var Zt_PrintVersion typeinfo.Flow

print_version, a type of flow.

View Source
var Zt_QuitGame typeinfo.Flow

quit_game, a type of flow.

View Source
var Zt_SaveGame typeinfo.Flow

save_game, a type of flow.

View Source
var Zt_UndoTurn typeinfo.Flow

undo_turn, a type of flow.

Functions

func Register added in v0.24.7

func Register(reg func(any))

gob like registration

Types

type LoadGame

type LoadGame struct {
	Markup map[string]any `json:",omitempty"`
}

Load the most recent save.

func (*LoadGame) Execute

func (*LoadGame) Execute(run rt.Runtime) error

todo: it'd be nice for the user to be able to type a name for the file as part of the thing including a "request list of save files" type of command would either need a parser action that can transparently eat words "load name of my save" ( and change Signal into a struct with data ) -- could also have the play engine handle the player interaction -- but that seems less flexible.

func (*LoadGame) GetMarkup

func (op *LoadGame) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*LoadGame) TypeInfo

func (*LoadGame) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type LoadGame_Slice

type LoadGame_Slice []LoadGame

Holds a slice of type LoadGame.

func (*LoadGame_Slice) Repeats

func (op *LoadGame_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of LoadGame.

func (*LoadGame_Slice) TypeInfo

func (*LoadGame_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of LoadGame.

type PrintVersion

type PrintVersion struct {
	Markup map[string]any `json:",omitempty"`
}

Print the version of the tap executable.

func (*PrintVersion) Execute

func (*PrintVersion) Execute(run rt.Runtime) (_ error)

fix: need to think about this. requiring package files or even runtime debug seems iffy.

func (*PrintVersion) GetMarkup

func (op *PrintVersion) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*PrintVersion) TypeInfo

func (*PrintVersion) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PrintVersion_Slice

type PrintVersion_Slice []PrintVersion

Holds a slice of type PrintVersion.

func (*PrintVersion_Slice) Repeats

func (op *PrintVersion_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PrintVersion.

func (*PrintVersion_Slice) TypeInfo

func (*PrintVersion_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PrintVersion.

type QuitGame

type QuitGame struct {
	Markup map[string]any `json:",omitempty"`
}

Immediately end the current game.

func (*QuitGame) Execute

func (*QuitGame) Execute(run rt.Runtime) error

returns SignalQuit any prompting of the user ( ie. are you sure? ) should happen *before* quit is called.

func (*QuitGame) GetMarkup

func (op *QuitGame) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*QuitGame) TypeInfo

func (*QuitGame) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type QuitGame_Slice

type QuitGame_Slice []QuitGame

Holds a slice of type QuitGame.

func (*QuitGame_Slice) Repeats

func (op *QuitGame_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of QuitGame.

func (*QuitGame_Slice) TypeInfo

func (*QuitGame_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of QuitGame.

type SaveGame

type SaveGame struct {
	Markup map[string]any `json:",omitempty"`
}

Save the game.

func (*SaveGame) Execute

func (*SaveGame) Execute(run rt.Runtime) error

func (*SaveGame) GetMarkup

func (op *SaveGame) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*SaveGame) TypeInfo

func (*SaveGame) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type SaveGame_Slice

type SaveGame_Slice []SaveGame

Holds a slice of type SaveGame.

func (*SaveGame_Slice) Repeats

func (op *SaveGame_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of SaveGame.

func (*SaveGame_Slice) TypeInfo

func (*SaveGame_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of SaveGame.

type UndoTurn

type UndoTurn struct {
	Markup map[string]any `json:",omitempty"`
}

Unimplemented: rewind the game to undo the player's most recent input.

func (*UndoTurn) Execute

func (*UndoTurn) Execute(run rt.Runtime) error

func (*UndoTurn) GetMarkup

func (op *UndoTurn) GetMarkup(ensure bool) map[string]any

Implements typeinfo.Markup

func (*UndoTurn) TypeInfo

func (*UndoTurn) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type UndoTurn_Slice

type UndoTurn_Slice []UndoTurn

Holds a slice of type UndoTurn.

func (*UndoTurn_Slice) Repeats

func (op *UndoTurn_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of UndoTurn.

func (*UndoTurn_Slice) TypeInfo

func (*UndoTurn_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of UndoTurn.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL