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 ¶
- Variables
- func Register(reg func(any))
- type Collector
- type Endpoint
- type Frame
- type FrameOutput
- type FrameOutput_Slice
- type Frame_Slice
- type GameSignal
- type GameSignal_Slice
- type Notification
- type Notification_Slot
- type Notification_Slots
- type PairChanged
- type PairChanged_Slice
- type SceneEnded
- type SceneEnded_Slice
- type SceneStarted
- type SceneStarted_Slice
- type Shuttle
- type StateChanged
- type StateChanged_Slice
Constants ¶
This section is empty.
Variables ¶
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
var Zt_Frame typeinfo.Flow
frame, a type of flow.
var Zt_FrameOutput typeinfo.Flow
frame_output, a type of flow.
var Zt_GameSignal typeinfo.Flow
game_signal, a type of flow.
var Zt_Notification = typeinfo.Slot{ Name: "notification", Markup: map[string]any{ "--": "Marker interface used by all frame events.", }, }
notification, a type of slot.
var Zt_PairChanged typeinfo.Flow
pair_changed, a type of flow.
var Zt_SceneEnded typeinfo.Flow
scene_ended, a type of flow.
var Zt_SceneStarted typeinfo.Flow
scene_started, a type of flow.
var Zt_StateChanged typeinfo.Flow
state_changed, a type of flow.
Functions ¶
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)
maybe also "$weave", "$shutdown" ... note: instead of sending "input" we send a fabricate command.....
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 ¶
Implements typeinfo.Markup
type FrameOutput ¶
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
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 ¶
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 ¶
One or more scenes ( aka domain ) have finished.
func (*SceneEnded) GetMarkup ¶
func (op *SceneEnded) GetMarkup(ensure bool) map[string]any
Implements typeinfo.Markup
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 ¶
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
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.