atoms

package
v0.0.0-...-fcffdc5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AreaLayer = 1
	TurfLayer = 2
	ObjLayer  = 3
	MobLayer  = 4
)

Variables

This section is empty.

Functions

func ContainingArea

func ContainingArea(atom types.Value) types.Value

func MobSetClient

func MobSetClient(mobV types.Value, client types.Value)

func NewAreaData

func NewAreaData(src *types.Datum, _ *AreaData, _ ...types.Value)

func NewAtomData

func NewAtomData(src *types.Datum, data *AtomData, args ...types.Value)

func NewAtomMovableData

func NewAtomMovableData(src *types.Datum, _ *AtomMovableData, _ ...types.Value)

func NewMobData

func NewMobData(src *types.Datum, _ *MobData, _ ...types.Value)

func NewObjData

func NewObjData(src *types.Datum, _ *ObjData, _ ...types.Value)

func NewTurfData

func NewTurfData(src *types.Datum, _ *TurfData, _ ...types.Value)

func SetWalkState

func SetWalkState(src types.Value, ws WalkState)

not for general use; just for pathfinding system

func TurfsInArea

func TurfsInArea(area types.Value) (turfs []types.Value)

Types

type Appearance

type Appearance struct {
	Icon      *icon.Icon
	IconState string
	Layer     int
	Name      string
	Desc      string
	Suffix    string
}

func (Appearance) Invoke

func (a Appearance) Invoke(usr *types.Datum, name string, parameters ...types.Value) types.Value

func (Appearance) SetVar

func (a Appearance) SetVar(name string, value types.Value)

func (Appearance) String

func (a Appearance) String() string

func (Appearance) ToSprite

func (a Appearance) ToSprite(x, y uint, dir common.Direction) (bool, int, sprite.GameSprite)

func (Appearance) Var

func (a Appearance) Var(name string) types.Value

type AreaData

type AreaData struct{}

type AtomData

type AtomData struct {
	VarAppearance Appearance
	VarDensity    int
	VarOpacity    int
	VarVerbs      []Verb
	// contains filtered or unexported fields
}

func AtomDataChunk

func AtomDataChunk(v types.Value) (*AtomData, bool)

func (*AtomData) GetContents

func (d *AtomData) GetContents(src *types.Datum) types.Value

func (*AtomData) GetDesc

func (d *AtomData) GetDesc(src *types.Datum) types.Value

func (*AtomData) GetDir

func (d *AtomData) GetDir(src *types.Datum) types.Value

func (*AtomData) GetIcon

func (d *AtomData) GetIcon(src *types.Datum) types.Value

func (*AtomData) GetIconState

func (d *AtomData) GetIconState(src *types.Datum) types.Value

func (*AtomData) GetLayer

func (d *AtomData) GetLayer(src *types.Datum) types.Value

func (*AtomData) GetLoc

func (d *AtomData) GetLoc(src *types.Datum) types.Value

func (*AtomData) GetName

func (d *AtomData) GetName(src *types.Datum) types.Value

func (*AtomData) GetSuffix

func (d *AtomData) GetSuffix(src *types.Datum) types.Value

func (*AtomData) GetX

func (d *AtomData) GetX(src *types.Datum) types.Value

func (*AtomData) GetY

func (d *AtomData) GetY(src *types.Datum) types.Value

func (*AtomData) GetZ

func (d *AtomData) GetZ(src *types.Datum) types.Value

func (*AtomData) ProcBump

func (d *AtomData) ProcBump(src *types.Datum, usr *types.Datum, obstacle types.Value) types.Value

func (*AtomData) ProcEnter

func (d *AtomData) ProcEnter(src *types.Datum, usr *types.Datum, atom types.Value, oldloc types.Value) types.Value

func (*AtomData) ProcEntered

func (d *AtomData) ProcEntered(src *types.Datum, usr *types.Datum, atom types.Value, oldloc types.Value) types.Value

func (*AtomData) ProcExit

func (d *AtomData) ProcExit(src *types.Datum, usr *types.Datum, atom types.Value, newloc types.Value) types.Value

func (*AtomData) ProcExited

func (d *AtomData) ProcExited(src *types.Datum, usr *types.Datum, atom types.Value, newloc types.Value) types.Value

func (*AtomData) ProcMove

func (d *AtomData) ProcMove(src *types.Datum, usr *types.Datum, newloc types.Value, direction types.Value) types.Value

func (*AtomData) ProcStat

func (d *AtomData) ProcStat(src *types.Datum, usr *types.Datum) types.Value

func (*AtomData) SetDesc

func (d *AtomData) SetDesc(src *types.Datum, value types.Value)

func (*AtomData) SetDir

func (d *AtomData) SetDir(src *types.Datum, value types.Value)

func (*AtomData) SetIcon

func (d *AtomData) SetIcon(src *types.Datum, value types.Value)

func (*AtomData) SetIconState

func (d *AtomData) SetIconState(src *types.Datum, value types.Value)

func (*AtomData) SetLayer

func (d *AtomData) SetLayer(src *types.Datum, value types.Value)

func (*AtomData) SetLoc

func (d *AtomData) SetLoc(src *types.Datum, location types.Value)

func (*AtomData) SetName

func (d *AtomData) SetName(src *types.Datum, value types.Value)

func (*AtomData) SetSuffix

func (d *AtomData) SetSuffix(src *types.Datum, value types.Value)

type AtomMovableData

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

func AtomMovableDataChunk

func AtomMovableDataChunk(v types.Value) (*AtomMovableData, bool)

type MobData

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

func MobDataChunk

func MobDataChunk(v types.Value) (*MobData, bool)

func (*MobData) EndStatContext

func (m *MobData) EndStatContext() sprite.StatDisplay

func (*MobData) GetClient

func (m *MobData) GetClient(src *types.Datum) types.Value

func (*MobData) GetKey

func (m *MobData) GetKey(src *types.Datum) types.Value

func (*MobData) OperatorWrite

func (m *MobData) OperatorWrite(src *types.Datum, usr *types.Datum, output types.Value) types.Value

func (*MobData) ProcLogin

func (m *MobData) ProcLogin(src *types.Datum, usr *types.Datum) types.Value

func (*MobData) StartStatContext

func (m *MobData) StartStatContext(src *types.Datum)

func (*MobData) StatContext

func (m *MobData) StatContext() *StatContext

type ObjData

type ObjData struct{}

type StatContext

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

func (*StatContext) Display

func (s *StatContext) Display() sprite.StatDisplay

func (*StatContext) Stat

func (s *StatContext) Stat(name string, value types.Value)

func (*StatContext) StatPanel

func (s *StatContext) StatPanel(panel string) bool

type TurfData

type TurfData struct {
	X uint
	Y uint
	Z uint
}

func (*TurfData) GetX

func (t *TurfData) GetX(src *types.Datum) types.Value

func (*TurfData) GetY

func (t *TurfData) GetY(src *types.Datum) types.Value

func (*TurfData) GetZ

func (t *TurfData) GetZ(src *types.Datum) types.Value

func (*TurfData) ProcEnter

func (t *TurfData) ProcEnter(src *types.Datum, usr *types.Datum, atom types.Value, oldloc types.Value) types.Value

func (*TurfData) ProcEntered

func (t *TurfData) ProcEntered(src *types.Datum, usr *types.Datum, atom types.Value, oldloc types.Value) types.Value

func (*TurfData) ProcExit

func (t *TurfData) ProcExit(src *types.Datum, usr *types.Datum, atom types.Value, newloc types.Value) types.Value

func (*TurfData) ProcExited

func (t *TurfData) ProcExited(src *types.Datum, usr *types.Datum, atom types.Value, newloc types.Value) types.Value

func (*TurfData) SetX

func (t *TurfData) SetX(src *types.Datum, x types.Value)

func (*TurfData) SetY

func (t *TurfData) SetY(src *types.Datum, y types.Value)

func (*TurfData) SetZ

func (t *TurfData) SetZ(src *types.Datum, z types.Value)

type Verb

type Verb struct {
	VisibleName  string
	DefiningType string
	ProcName     string
}

NOTE: although verbs have a "defining type", which can be inspected, all that ultimately matters is the procedure name, because that is what actually gets called when the verb is invoked.

func NewVerb

func NewVerb(visibleName, defType, procName string) Verb

func (Verb) Apply

func (v Verb) Apply(src *types.Datum, usr *types.Datum, args []types.Value)

func (Verb) Invoke

func (v Verb) Invoke(usr *types.Datum, name string, parameters ...types.Value) types.Value

func (Verb) Matches

func (v Verb) Matches(name string, src *types.Datum, usr *types.Datum, args []string) bool

func (Verb) ResolveArgs

func (v Verb) ResolveArgs(src *types.Datum, usr *types.Datum, args []string) ([]types.Value, error)

func (Verb) SetVar

func (v Verb) SetVar(name string, value types.Value)

func (Verb) String

func (v Verb) String() string

func (Verb) Var

func (v Verb) Var(name string) types.Value

type ViewMode

type ViewMode uint
const (
	ViewInclusive ViewMode = iota // corresponds to view proc
	ViewExclusive                 // corresponds to oview proc
	ViewVisual                    // actual visual drawn elements; like 'view' but excludes contents of player
)

type WalkState

type WalkState struct {
	WalkTarget    types.Value
	WalkMinimum   int
	WalkCountdown int
	WalkLagTicks  int
}

func GetWalkState

func GetWalkState(src types.Value) WalkState

not for general use; just for pathfinding system

type World

type World interface {
	PlayerExists(client types.Value) bool
	MaxXYZ() (uint, uint, uint)
	SetMaxXYZ(x, y, z uint)
	LocateXYZ(x, y, z uint) (turf types.Value)
	Realm() *types.Realm
	Icon(name string) *icon.Icon
	FindAll(predicate func(*types.Datum) bool) []types.Value
	FindAllType(tp types.TypePath) []types.Value
	FindOne(predicate func(*types.Datum) bool) types.Value
	FindOneType(tp types.TypePath) types.Value
	View(distance uint, centerD *types.Datum, mode ViewMode) []types.Value
	View1(centerD *types.Datum, mode ViewMode) []types.Value
	ListVerbsOnAtom(client types.Value, atom *types.Datum) (verbs []string)
	Flick(icon *icon.Icon, icon_state string, target types.Value)
}

func WorldOf

func WorldOf(t *types.Datum) World

Jump to

Keyboard shortcuts

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