game

package
v0.0.0-...-b84ae58 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OperationAborted  = fmt.Errorf("operation aborted")
	WhitespacePattern = regexp.MustCompile("\\s+")
)

Functions

This section is empty.

Types

type Env

type Env struct {
	Game   *Game
	User   *storage.User
	Object storage.Object
	Sess   sshtcelltty.InterleavedSSHSession
	Term   *terminal.Terminal
}

Represents the environment of a connected user.

func (*Env) Connect

func (e *Env) Connect() error

func (*Env) Process

func (e *Env) Process() error

func (*Env) SelectExec

func (e *Env) SelectExec(options map[string]func() error) error

func (*Env) SelectReturn

func (e *Env) SelectReturn(prompt string, options []string) (string, error)

type Game

type Game struct {
	Storage *storage.Storage
}

Represents the game world.

func New

func New(storage *storage.Storage) *Game

func (*Game) HandleSession

func (g *Game) HandleSession(sess ssh.Session)

Jump to

Keyboard shortcuts

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