Documentation
¶
Overview ¶
Package cond is the When of a branch: who is in what state, every clause saying whom it is about.
When: cond.Other.If(traveller). And(cond.Self.If(cond.Not(talking))). And(cond.Self.If(cond.Not(talked))),
Clauses ¶
Self, Other, Around and On each take one state: an effect the entity is under, a role it plays, a Word of the moment, Chance, Always, or Not of any of them. Clauses join with And and Or; Not of a whole Cond turns it round. At the top of a rule a role of Self or of Other narrows whom the host walks; anywhere else it is asked of the entity as the branch runs.
Words ¶
A moment's or a fact's words are its owner's, made with NewWord: a predicate of the moment or the fact under a name. A word says whether it is of the entity or of the other (Word.OfOther), and a clause of the wrong side is refused as the branch is built.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Self is the entity the branch is about. Self = Subject{who{/* contains filtered or unexported fields */}} // Other is the other of the pair the moment met, or the subject of the moment or the fact; // a clause of it does not hold while there is none. Other = Subject{who{/* contains filtered or unexported fields */}} )
Functions ¶
This section is empty.
Types ¶
type Cond ¶
type Cond interface {
// And holds where both hold.
And(c Cond) Cond
// Or holds where either holds.
Or(c Cond) Cond
// contains filtered or unexported methods
}
Cond is a branch's When: clauses of who is in what state, joined with And and Or.
type Ever ¶
type Ever struct{}
Ever is the state everybody is in.
var Always Ever
Always is the state everybody is in: Self(Always) holds every tick.
type Likelihood ¶
type Likelihood struct {
// contains filtered or unexported fields
}
Likelihood is what Chance makes.
func Chance ¶
func Chance(p float64) Likelihood
Chance is the state of being drawn with the likelihood p, drawn afresh every step from the world's seed, the game time and the entity asked, so a load and a replay draw alike.
type Roles ¶
type Roles struct{}
Roles is the family of roles: one tag.Tags[Roles] on an entity holds every role it plays.
type Subject ¶
type Subject struct {
// contains filtered or unexported fields
}
Subject is whom a clause is about: Self, Other, Around(n) or On(plugin). If makes the clause.
type Word ¶
type Word[P any] struct { // contains filtered or unexported fields }
Word is a word of a moment or a fact P: a state Self or Other is in as the moment says (unit.Fallen, vision.SeesNobody); a plugin makes its own with NewWord, a game those of its own facts.