kindsOf

package
v0.24.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

package kindsOf defines a handful of built-in base types for tapestry kinds. a kind is a sharable set of author defined fields used by the runtime.

Index

Constants

This section is empty.

Variables

View Source
var DefaultKinds = []Kinds{
	Aspect, Kind, Pattern, Record, Relation, Response, Action,
}

Functions

This section is empty.

Types

type Kinds

type Kinds int

default kinds

const (
	// a set of exclusive boolean fields which apply to a noun;
	// a kind supports many aspects, a noun can only have one field of each aspect.
	Aspect Kinds = 1 << iota // aspects

	// a base for all abstract and concrete nouns:
	// nouns are globally accessible objects identified by unique names.
	Kind // kinds

	// used for user defined functions.
	// the fields of a pattern define the parameters and return values.
	Pattern // patterns

	// a base for any structured data type held by variables and kinds.
	Record // records

	// describe how nouns pair with other nouns.
	// the fields of relation define the number and kind of nouns on each side of the pairing.
	Relation // relations

	// a single kind, the fields of which define stock phrases relayed to the player.
	// ex. "can't act in the dark" -> "It is pitch dark, and you can't see a thing."
	// ( patterns have parameters and return values; responses don't. )
	Response // responses

	// a special kind of pattern used for handling events.
	Action Kinds = Pattern | 1<<iota // actions
)

note: iota increases even when not specified so every kind has a unique bit; re-specifying it combines with earlier kinds to indicate sub-types. ( Kind is an abstract or concrete noun defined by some story. )

const None Kinds = 0 //

func FindDefaultKind

func FindDefaultKind(str string) (ret Kinds)

given a string, return the default kind that it exactly matches (if any)

func (Kinds) Parent

func (k Kinds) Parent() (ret Kinds)

func (Kinds) String

func (i Kinds) String() string

Jump to

Keyboard shortcuts

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