world

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: 15 Imported by: 1

Documentation

Index

Constants

View Source
const SpriteSize = 32

Variables

This section is empty.

Functions

func AbsDiff

func AbsDiff(a uint, b uint) uint

func FlickClient

func FlickClient(client *types.Datum, flick sprite.Flick)

func GetDir

func GetDir(from, to types.Value) common.Direction

func GetStepTo

func GetStepTo(ref, target types.Value, min int) types.Value

func InvokeVerb

func InvokeVerb(client types.Value, verb string)

func ManhattanDistance

func ManhattanDistance(a, b types.Value) uint

func MaxUint

func MaxUint(a uint, b uint) uint

func NewClientData

func NewClientData(_ *types.Datum, _ *ClientData, _ ...types.Value)

func PullClientRequests

func PullClientRequests(client *types.Datum) (textDisplay []string, sounds []sprite.Sound, flicks []sprite.Flick)

func StepTo

func StepTo(usr *types.Datum, ref, target types.Value, min int) bool

func UpdateWalk

func UpdateWalk(src types.Value)

not intended for public use

func WalkTo

func WalkTo(ref, target types.Value, min, lag int)

func XY

func XY(atom types.Value) (uint, uint)

func XYZ

func XYZ(atom types.Value) (uint, uint, uint)

Types

type ClientData

type ClientData struct {
	VarKey     string
	VarView    int
	VarStatobj *types.Ref
	// contains filtered or unexported fields
}

func ClientDataChunk

func ClientDataChunk(v types.Value) (*types.Datum, *ClientData)

func (*ClientData) GetEye

func (d *ClientData) GetEye(src *types.Datum) types.Value

func (*ClientData) GetMob

func (d *ClientData) GetMob(src *types.Datum) types.Value

func (*ClientData) GetVirtualEye

func (d *ClientData) GetVirtualEye(src *types.Datum) types.Value

func (*ClientData) ListVerbs

func (d *ClientData) ListVerbs(src *types.Datum) (verbs []string, available map[*types.Datum][]string)

func (*ClientData) OperatorWrite

func (d *ClientData) OperatorWrite(src *types.Datum, usr *types.Datum, output types.Value) types.Value

func (*ClientData) ProcDel

func (d *ClientData) ProcDel(src *types.Datum, usr *types.Datum) types.Value

func (*ClientData) ProcEast

func (d *ClientData) ProcEast(src *types.Datum, usr *types.Datum) types.Value

func (*ClientData) ProcMove

func (d *ClientData) ProcMove(src *types.Datum, usr *types.Datum, loc types.Value, dir types.Value) types.Value

func (*ClientData) ProcNew

func (d *ClientData) ProcNew(src *types.Datum, _ *types.Datum, usr types.Value) types.Value

func (*ClientData) ProcNorth

func (d *ClientData) ProcNorth(src *types.Datum, usr *types.Datum) types.Value

func (*ClientData) ProcSouth

func (d *ClientData) ProcSouth(src *types.Datum, usr *types.Datum) types.Value

func (*ClientData) ProcStat

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

func (*ClientData) ProcWest

func (d *ClientData) ProcWest(src *types.Datum, usr *types.Datum) types.Value

func (*ClientData) ResolveVerb

func (d *ClientData) ResolveVerb(src *types.Datum, verbName string, args []string)

func (*ClientData) SetEye

func (d *ClientData) SetEye(src *types.Datum, eye types.Value)

func (*ClientData) SetMob

func (d *ClientData) SetMob(src *types.Datum, mob types.Value)

type World

type World struct {
	Name     string
	Mob      types.TypePath
	ViewDist uint

	MaxX, MaxY, MaxZ uint
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld(realm *types.Realm, cache *icon.IconCache) *World

func (*World) CreateNewPlayer

func (w *World) CreateNewPlayer(key string) *types.Datum

func (*World) FindAll

func (w *World) FindAll(predicate func(*types.Datum) bool) []types.Value

func (*World) FindAllType

func (w *World) FindAllType(tp types.TypePath) []types.Value

func (*World) FindOne

func (w *World) FindOne(predicate func(*types.Datum) bool) types.Value

func (*World) FindOneType

func (w *World) FindOneType(tp types.TypePath) types.Value

func (*World) Flick

func (w *World) Flick(icon *icon.Icon, iconState string, target types.Value)

func (*World) Icon

func (w *World) Icon(name string) *icon.Icon

func (*World) ListVerbsOnAtom

func (w *World) ListVerbsOnAtom(client types.Value, atom *types.Datum) (verbs []string)

func (*World) LocateXYZ

func (w *World) LocateXYZ(x, y, z uint) types.Value

func (World) MaxXYZ

func (w World) MaxXYZ() (uint, uint, uint)

func (*World) PlayerExists

func (w *World) PlayerExists(client types.Value) bool

func (*World) Realm

func (w *World) Realm() *types.Realm

func (*World) RemovePlayer

func (w *World) RemovePlayer(client *types.Datum)

func (*World) RenderClientView

func (w *World) RenderClientView(client types.Value) (center types.Value, viewAtoms []types.Value, stat sprite.StatDisplay, verbs []string, verbsOn map[*types.Datum][]string)

func (*World) ServerAPI

func (w *World) ServerAPI() websession.WorldAPI

func (*World) SetMaxXYZ

func (w *World) SetMaxXYZ(x, y, z uint)

func (*World) UpdateDefaultViewDistance

func (w *World) UpdateDefaultViewDistance()

func (*World) View

func (w *World) View(distance uint, centerD *types.Datum, mode atoms.ViewMode) []types.Value

note: this does not handle the "centerD = nil" case the same as DreamMaker

func (*World) View1

func (w *World) View1(center *types.Datum, mode atoms.ViewMode) []types.Value

func (*World) ViewX

func (w *World) ViewX(distance uint, center *types.Datum, perspective *types.Datum, mode atoms.ViewMode) []types.Value

func (*World) ViewXLocations

func (w *World) ViewXLocations(distance uint, center *types.Datum, perspective *types.Datum) []types.Value

Jump to

Keyboard shortcuts

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