frame

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: 16 Imported by: 1

Documentation

Overview

Package shuttle turns json based requests into game play. ex. for playing via a webserver.

Low level communication with a game server. None of these commands are available for use in game scripts.

Index

Constants

This section is empty.

Variables

View Source
var Z_Types = typeinfo.TypeSet{
	Name: "frame",
	Comment: []string{
		"Low level communication with a game server.",
		"None of these commands are available for use in game scripts.",
	},

	Slot:       z_slot_list,
	Flow:       z_flow_list,
	Signatures: z_signatures,
}

package listing of type data

View Source
var Zt_Frame typeinfo.Flow

frame, a type of flow.

View Source
var Zt_FrameOutput typeinfo.Flow

frame_output, a type of flow.

View Source
var Zt_GameSignal typeinfo.Flow

game_signal, a type of flow.

View Source
var Zt_Notification = typeinfo.Slot{
	Name: "notification",
	Markup: map[string]any{
		"--": "Marker interface used by all frame events.",
	},
}

notification, a type of slot.

View Source
var Zt_PairChanged typeinfo.Flow

pair_changed, a type of flow.

View Source
var Zt_SceneEnded typeinfo.Flow

scene_ended, a type of flow.

View Source
var Zt_SceneStarted typeinfo.Flow

scene_started, a type of flow.

View Source
var Zt_StateChanged typeinfo.Flow

state_changed, a type of flow.

Functions

func Register added in v0.24.7

func Register(reg func(any))

gob like registration

Types

type Collector added in v0.24.7

type Collector struct {
	// contains filtered or unexported fields
}

Queues incoming events and collects text output between events.

func (*Collector) GetEvents added in v0.24.7

func (out *Collector) GetEvents() (ret []Notification)

returns and clears all events

type Endpoint added in v0.24.7

type Endpoint int

Destinations for POST the same endpoint may respond in different ways depending on the game State(s)

const (
	Restart Endpoint = iota // restart
	Query                   // query
)

maybe also "$weave", "$shutdown" ... note: instead of sending "input" we send a fabricate command.....

func (Endpoint) String added in v0.24.7

func (i Endpoint) String() string

type Frame

type Frame struct {
	Result string
	Events []Notification
	Error  string
	Markup map[string]any `json:",omitempty"`
}

The results of a a player initiated turn, or other client to server query.

func (*Frame) GetMarkup

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

Implements typeinfo.Markup

func (*Frame) TypeInfo

func (*Frame) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type FrameOutput

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

Printed text that should be visible the player.

func (*FrameOutput) GetMarkup

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

Implements typeinfo.Markup

func (*FrameOutput) TypeInfo

func (*FrameOutput) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type FrameOutput_Slice

type FrameOutput_Slice []FrameOutput

Holds a slice of type FrameOutput.

func (*FrameOutput_Slice) Repeats

func (op *FrameOutput_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of FrameOutput.

func (*FrameOutput_Slice) TypeInfo

func (*FrameOutput_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of FrameOutput.

type Frame_Slice

type Frame_Slice []Frame

Holds a slice of type Frame.

func (*Frame_Slice) Repeats

func (op *Frame_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of Frame.

func (*Frame_Slice) TypeInfo

func (*Frame_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of Frame.

type GameSignal added in v0.24.7

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

System game event.

func (*GameSignal) GetMarkup added in v0.24.7

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

Implements typeinfo.Markup

func (*GameSignal) TypeInfo added in v0.24.7

func (*GameSignal) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type GameSignal_Slice added in v0.24.7

type GameSignal_Slice []GameSignal

Holds a slice of type GameSignal.

func (*GameSignal_Slice) Repeats added in v0.24.7

func (op *GameSignal_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of GameSignal.

func (*GameSignal_Slice) TypeInfo added in v0.24.7

func (*GameSignal_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of GameSignal.

type Notification added in v0.24.6

type Notification interface{}

marker interface for frame commands. ( assigned to those commands in the frame.idl )

type Notification_Slot added in v0.24.6

type Notification_Slot struct{ Value Notification }

Holds a single slot.

func (*Notification_Slot) TypeInfo added in v0.24.6

func (*Notification_Slot) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a single slot.

type Notification_Slots added in v0.24.6

type Notification_Slots []Notification

Holds a slice of slots.

func (*Notification_Slots) Repeats added in v0.24.6

func (op *Notification_Slots) Repeats() bool

Implements typeinfo.Repeats for a slice of slots.

func (*Notification_Slots) TypeInfo added in v0.24.6

func (*Notification_Slots) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of slots.

type PairChanged

type PairChanged struct {
	A      string
	B      string
	Rel    string
	Markup map[string]any `json:",omitempty"`
}

The relationship between two objects has changed. For instance, an object's whereabouts as indicated by a parent-child type relation.

func (*PairChanged) GetMarkup

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

Implements typeinfo.Markup

func (*PairChanged) TypeInfo

func (*PairChanged) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type PairChanged_Slice

type PairChanged_Slice []PairChanged

Holds a slice of type PairChanged.

func (*PairChanged_Slice) Repeats

func (op *PairChanged_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of PairChanged.

func (*PairChanged_Slice) TypeInfo

func (*PairChanged_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of PairChanged.

type SceneEnded

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

One or more scenes ( aka domain ) have finished.

func (*SceneEnded) GetMarkup

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

Implements typeinfo.Markup

func (*SceneEnded) TypeInfo

func (*SceneEnded) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type SceneEnded_Slice

type SceneEnded_Slice []SceneEnded

Holds a slice of type SceneEnded.

func (*SceneEnded_Slice) Repeats

func (op *SceneEnded_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of SceneEnded.

func (*SceneEnded_Slice) TypeInfo

func (*SceneEnded_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of SceneEnded.

type SceneStarted

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

One or more scenes ( aka domain ) have started.

func (*SceneStarted) GetMarkup

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

Implements typeinfo.Markup

func (*SceneStarted) TypeInfo

func (*SceneStarted) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type SceneStarted_Slice

type SceneStarted_Slice []SceneStarted

Holds a slice of type SceneStarted.

func (*SceneStarted_Slice) Repeats

func (op *SceneStarted_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of SceneStarted.

func (*SceneStarted_Slice) TypeInfo

func (*SceneStarted_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of SceneStarted.

type Shuttle added in v0.24.7

type Shuttle struct {
	// contains filtered or unexported fields
}

Shuttle uses json commands to talk back and forth to a runtime. see: idl frame.

func NewShuttle added in v0.24.7

func NewShuttle(run *qna.Runner, dec *query.QueryDecoder) *Shuttle

func (*Shuttle) Post added in v0.24.7

func (c *Shuttle) Post(w io.Writer, endpoint string, msg json.RawMessage) (err error)

func (*Shuttle) Restart added in v0.24.7

func (c *Shuttle) Restart(scene string) (err error)

type StateChanged

type StateChanged struct {
	Noun   string
	Aspect string
	Prev   string
	Trait  string
	Markup map[string]any `json:",omitempty"`
}

Some object in the game has changed from one state to another.

func (*StateChanged) GetMarkup

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

Implements typeinfo.Markup

func (*StateChanged) TypeInfo

func (*StateChanged) TypeInfo() typeinfo.T

Implements typeinfo.Instance

type StateChanged_Slice

type StateChanged_Slice []StateChanged

Holds a slice of type StateChanged.

func (*StateChanged_Slice) Repeats

func (op *StateChanged_Slice) Repeats() bool

Implements typeinfo.Repeats for a slice of StateChanged.

func (*StateChanged_Slice) TypeInfo

func (*StateChanged_Slice) TypeInfo() typeinfo.T

Implements typeinfo.Instance for a slice of StateChanged.

Jump to

Keyboard shortcuts

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