Documentation
¶
Index ¶
Constants ¶
const ( RequestingPlayerInput = "requesting player input" StartGame = "start game" PassTime = "pass time" RunningAnAction = "running an action" )
expected play time patterns
const ( Actor = "actor" Action = "action" FirstNoun = "first noun" SecondNoun = "second noun" )
expected parameter names
const OutOfWorldPrefix = "request "
convention for actions which don't advance time
Variables ¶
This section is empty.
Functions ¶
func CaptureInput ¶ added in v0.24.7
func CaptureInput(pt *Playtime)
used for letting the unit tests fabricate input as if typed by the player.
Types ¶
type Noun ¶
type Noun struct {
// contains filtered or unexported fields
}
these are created by the survey
func (*Noun) HasAttribute ¶
does the noun have the passed trait?
type Playtime ¶
Playtime - adapts the qna.Runner rt.Runtime to the parser this is VERY rudimentary.
func NewPlaytime ¶
func (*Playtime) HandleTurn ¶ added in v0.24.8
advance time
func (*Playtime) RunPlayerAction ¶ added in v0.24.8
type Survey ¶
type Survey struct {
// contains filtered or unexported fields
}
the survey creates bounds: areas of the world containing sets of nouns.
func MakeDefaultSurveyor ¶
func MakeSurveyor ¶
todo: the "patter" refers to bounds for the player ideally all of the bounds functions would be in script and neither "player" nor "relation" would live here.
func (*Survey) GetBounds ¶
fix: PlayerBounds, PlayerLocale and ObjectBounds might be better delegated to scripts. it would use the same bits as "locationBounded", only all the bounds requests would use it. the scripts would switch on the passed string similar to this -- ( one string and assume that the parser always refers to whatever actor in the global player variable ) that would probably narrow the dependency on rt -- maybe just to a "call" that could be configured with rt externally. ( the "Scope" command could request the named pattern to ensure it exists. )
func (*Survey) GetFocalObject ¶
return the id of the focal object; returns nil on error; ex. self