command

package
v0.0.0-...-0e3aaa5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandTypeUseItem = CommandType(iota)
	CommandTypeDropItem
	CommandTypeSetFavorite
	CommandTypeToggleComponentFavorite
	CommandTypeSortInventory
	CommandTypeToggleQuest
	CommandTypeSetCustomMapMarker
	CommandTypeRemoveCustomMapMarker
	CommandTypeCheckFastTravel
	CommandTypeFastTravel
	CommandTypeMoveLocalMap
	CommandTypeZoomLocalMap
	CommandTypeToggleRadioStation
	CommandTypeRequestLocalMapSnapshot
	CommandTypeClearIdle
)

Well-known commands

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Type CommandType `json:"type"`
	Args []any       `json:"args"`
	ID   int         `json:"id"`
}

Command is the type for a Pip Boy fallout 4 command

type CommandType

type CommandType int

CommandType is the type for the command.type

func (CommandType) String

func (i CommandType) String() string

type Commander

type Commander struct {
	W io.ReadWriter
	// contains filtered or unexported fields
}

Commander is an abstraction for writing commands

func (*Commander) Execute

func (c *Commander) Execute(cmd CommandType, args ...any) (*Result, error)

Execute executes a command

type Result

type Result struct {
	Allowed bool
	Success bool
	ID      int
	Message string
}

Result is the response for a command

Jump to

Keyboard shortcuts

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