core

package
v0.0.0-...-8d7dea8 Latest Latest
Warning

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

Go to latest
Published: May 19, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ascending powers of 4
	ObjectSizeTinySlots   = 1   // e.g. a marble
	ObjectSizeSmallSlots  = 4   // e.g. a dagger or belt-pouch
	ObjectSizeMediumSlots = 16  // e.g. a sword
	ObjectSizeLargeSlots  = 64  // e.g. a breastplate or polearm
	ObjectSizeHugeSlots   = 256 // e.g. a giant's two-handed club
)
View Source
const (
	InventoryContainerBack  = "back"
	InventoryContainerBelt  = "belt"
	InventoryContainerBody  = "body"
	InventoryContainerHands = "hands"
)
View Source
const (
	CombatMeleeDamageTypeSlash = "slash"
	CombatMeleeDamageTypeStab  = "stab"
	CombatMeleeDamageTypeBash  = "bash"

	// reserved for NPCs
	CombatMeleeDamageTypeBite = "bite"
)
View Source
const (
	CommandTypeActorAddToZone = iota
	CommandTypeActorMove
	CommandTypeActorAdminRelocate
	CommandTypeActorRemoveFromZone
	CommandTypeActorDeath
	CommandTypeActorMigrateIn
	CommandTypeActorMigrateOut
	CommandTypeActorSpeak
	CommandTypeLocationAddToZone
	CommandTypeLocationUpdate
	CommandTypeLocationRemoveFromZone
	CommandTypeExitAddToZone
	CommandTypeExitUpdate
	CommandTypeExitRemoveFromZone
	CommandTypeObjectAddToZone
	CommandTypeObjectMove
	CommandTypeObjectMoveSubcontainer
	CommandTypeObjectAdminRelocate
	CommandTypeObjectRemoveFromZone
	CommandTypeZoneSetDefaultLocation
	CommandTypeCombatMelee
)
View Source
const (
	EventTypeActorMove = iota
	EventTypeActorAdminRelocate
	EventTypeActorAddToZone
	EventTypeActorRemoveFromZone
	EventTypeActorDeath
	EventTypeActorMigrateIn
	EventTypeActorMigrateOut
	EventTypeActorSpeak
	EventTypeLocationAddToZone
	EventTypeLocationRemoveFromZone
	EventTypeLocationUpdate
	EventTypeExitAddToZone
	EventTypeExitUpdate
	EventTypeExitRemoveFromZone
	EventTypeObjectAddToZone
	EventTypeObjectRemoveFromZone
	EventTypeObjectMove
	EventTypeObjectMoveSubcontainer
	EventTypeObjectAdminRelocate
	EventTypeObjectMigrateIn
	EventTypeObjectMigrateOut
	EventTypeZoneSetDefaultLocation
	EventTypeCombatMeleeDamage
	EventTypeCombatDodge
)
View Source
const (
	ExitDirectionNorth = "north"
	ExitDirectionSouth = "south"
	ExitDirectionEast  = "east"
	ExitDirectionWest  = "west"
)
View Source
const ContainerDefaultSubcontainer = "any"
View Source
const (
	// FIXME this braintype should be specified via config file, not a const
	// FIXME once that's done, be sure to delete this const to find all places
	// FIXME that need to use the configurable value instead
	PlayerParkingBrainType = "player-parking"
)

Variables

View Source
var (
	ActorMeleeDelay = time.Millisecond * 1000
)
View Source
var DefaultHumanInventoryConstraints = ActorInventoryConstraints{
	BackSlots:    1 * ObjectSizeLargeSlots,
	BackMaxItems: 2,
	BeltSlots:    2 * ObjectSizeMediumSlots,
	BeltMaxItems: 4,
	BodySlots:    1 * ObjectSizeLargeSlots,
	BodyMaxItems: 1,
	HandSlots:    1 * ObjectSizeLargeSlots,
	HandMaxItems: 2,
}

Functions

func NewActorDeathCommand

func NewActorDeathCommand(actor *Actor) *actorDeathCommand

func NewActorSpeakCommand

func NewActorSpeakCommand(actor *Actor, speech string) *actorSpeakCommand

Types

type Actor

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

func NewActor

func NewActor(id uuid.UUID, name, brainType string, location *Location, zone *Zone, attrs AttributeSet, skills Skillset, inventoryConstraints ActorInventoryConstraints) *Actor

func (*Actor) AddObserver

func (a *Actor) AddObserver(o Observer)

func (*Actor) AdminRelocate

func (a *Actor) AdminRelocate(to *Location) error

func (*Actor) Attributes

func (a *Actor) Attributes() AttributeSet

func (*Actor) Bite

func (a *Actor) Bite(target *Actor) error

func (*Actor) BrainType

func (a *Actor) BrainType() string

func (*Actor) Capacity

func (a *Actor) Capacity() int

func (*Actor) ContainsObject

func (a *Actor) ContainsObject(o *Object) bool

func (*Actor) Die

func (a *Actor) Die() error

func (*Actor) ID

func (a *Actor) ID() uuid.UUID

func (*Actor) Inventory

func (a *Actor) Inventory() *ActorInventory

func (*Actor) Location

func (a *Actor) Location() *Location

func (*Actor) Move

func (a *Actor) Move(from, to *Location) error

func (*Actor) Name

func (a *Actor) Name() string

func (*Actor) Objects

func (a *Actor) Objects() ObjectList

func (*Actor) Observers

func (a *Actor) Observers() ObserverList

func (*Actor) RemoveObserver

func (a *Actor) RemoveObserver(o Observer)

func (*Actor) Skills

func (a *Actor) Skills() Skillset

func (*Actor) Slash

func (a *Actor) Slash(target *Actor) error

func (*Actor) Speak

func (a *Actor) Speak(speech string) error

func (*Actor) SubcontainerFor

func (a *Actor) SubcontainerFor(o *Object) string

func (*Actor) Zone

func (a *Actor) Zone() *Zone

type ActorAddToZoneEvent

type ActorAddToZoneEvent struct {
	ActorID              uuid.UUID
	Name, BrainType      string
	StartingLocationID   uuid.UUID
	Attributes           AttributeSet
	Skills               Skillset
	InventoryConstraints ActorInventoryConstraints
	// contains filtered or unexported fields
}

func NewActorAddToZoneEvent

func NewActorAddToZoneEvent(name, brainType string, actorId, startingLocationId, zoneId uuid.UUID, attrs AttributeSet, skills Skillset, invConstraints ActorInventoryConstraints) *ActorAddToZoneEvent

func (ActorAddToZoneEvent) AggregateId

func (eg ActorAddToZoneEvent) AggregateId() uuid.UUID

func (ActorAddToZoneEvent) SequenceNumber

func (eg ActorAddToZoneEvent) SequenceNumber() uint64

func (ActorAddToZoneEvent) SetSequenceNumber

func (eg ActorAddToZoneEvent) SetSequenceNumber(num uint64)

func (ActorAddToZoneEvent) SetTimestamp

func (eg ActorAddToZoneEvent) SetTimestamp(t time.Time)

func (ActorAddToZoneEvent) ShouldPersist

func (eg ActorAddToZoneEvent) ShouldPersist() bool

func (ActorAddToZoneEvent) Timestamp

func (eg ActorAddToZoneEvent) Timestamp() time.Time

func (ActorAddToZoneEvent) Type

func (eg ActorAddToZoneEvent) Type() int

func (ActorAddToZoneEvent) Version

func (eg ActorAddToZoneEvent) Version() int

type ActorAdminRelocateEvent

type ActorAdminRelocateEvent struct {
	ActorID      uuid.UUID
	ToLocationID uuid.UUID
	// contains filtered or unexported fields
}

func NewActorAdminRelocateEvent

func NewActorAdminRelocateEvent(actorID, locID, zoneID uuid.UUID) *ActorAdminRelocateEvent

func (ActorAdminRelocateEvent) AggregateId

func (eg ActorAdminRelocateEvent) AggregateId() uuid.UUID

func (ActorAdminRelocateEvent) SequenceNumber

func (eg ActorAdminRelocateEvent) SequenceNumber() uint64

func (ActorAdminRelocateEvent) SetSequenceNumber

func (eg ActorAdminRelocateEvent) SetSequenceNumber(num uint64)

func (ActorAdminRelocateEvent) SetTimestamp

func (eg ActorAdminRelocateEvent) SetTimestamp(t time.Time)

func (ActorAdminRelocateEvent) ShouldPersist

func (eg ActorAdminRelocateEvent) ShouldPersist() bool

func (ActorAdminRelocateEvent) Timestamp

func (eg ActorAdminRelocateEvent) Timestamp() time.Time

func (ActorAdminRelocateEvent) Type

func (eg ActorAdminRelocateEvent) Type() int

func (ActorAdminRelocateEvent) Version

func (eg ActorAdminRelocateEvent) Version() int

type ActorDeathEvent

type ActorDeathEvent struct {
	ActorName string
	ActorID   uuid.UUID
	// contains filtered or unexported fields
}

func NewActorDeathEvent

func NewActorDeathEvent(name string, actorID, zoneID uuid.UUID) *ActorDeathEvent

func (ActorDeathEvent) AggregateId

func (eg ActorDeathEvent) AggregateId() uuid.UUID

func (ActorDeathEvent) SequenceNumber

func (eg ActorDeathEvent) SequenceNumber() uint64

func (ActorDeathEvent) SetSequenceNumber

func (eg ActorDeathEvent) SetSequenceNumber(num uint64)

func (ActorDeathEvent) SetTimestamp

func (eg ActorDeathEvent) SetTimestamp(t time.Time)

func (ActorDeathEvent) ShouldPersist

func (eg ActorDeathEvent) ShouldPersist() bool

func (ActorDeathEvent) Timestamp

func (eg ActorDeathEvent) Timestamp() time.Time

func (ActorDeathEvent) Type

func (eg ActorDeathEvent) Type() int

func (ActorDeathEvent) Version

func (eg ActorDeathEvent) Version() int

type ActorInventory

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

func (*ActorInventory) Capacity

func (ai *ActorInventory) Capacity() int

func (*ActorInventory) CapacityBySubcontainer

func (ai *ActorInventory) CapacityBySubcontainer(subname string) (int, int)

func (*ActorInventory) Constraints

func (ai *ActorInventory) Constraints() ActorInventoryConstraints

func (*ActorInventory) ContainsObject

func (ai *ActorInventory) ContainsObject(o *Object) bool

func (*ActorInventory) Objects

func (ai *ActorInventory) Objects() ObjectList

func (*ActorInventory) ObjectsBySubcontainer

func (ai *ActorInventory) ObjectsBySubcontainer(subname string) ObjectList

func (*ActorInventory) SubcontainerFor

func (ai *ActorInventory) SubcontainerFor(o *Object) string

type ActorInventoryConstraints

type ActorInventoryConstraints struct {
	BackSlots    int
	BackMaxItems int
	BeltSlots    int
	BeltMaxItems int
	BodySlots    int
	BodyMaxItems int
	HandSlots    int
	HandMaxItems int
}

type ActorList

type ActorList []*Actor

func (ActorList) Copy

func (al ActorList) Copy() ActorList

func (ActorList) IndexOf

func (al ActorList) IndexOf(actor *Actor) (int, error)

func (ActorList) Remove

func (al ActorList) Remove(actor *Actor) ActorList

type ActorMigrateInEvent

type ActorMigrateInEvent struct {
	ActorID               uuid.UUID
	Name, BrainType       string
	FromLocID, FromZoneID uuid.UUID
	ToLocID               uuid.UUID
	Attributes            AttributeSet
	Skills                Skillset
	InventoryConstraints  ActorInventoryConstraints
	// contains filtered or unexported fields
}

func NewActorMigrateInEvent

func NewActorMigrateInEvent(name, brainType string, actorID, fromLocID, fromZoneID, toLocID, zoneID uuid.UUID, attrs AttributeSet, skills Skillset, invConstraints ActorInventoryConstraints) *ActorMigrateInEvent

func (ActorMigrateInEvent) AggregateId

func (eg ActorMigrateInEvent) AggregateId() uuid.UUID

func (ActorMigrateInEvent) SequenceNumber

func (eg ActorMigrateInEvent) SequenceNumber() uint64

func (ActorMigrateInEvent) SetSequenceNumber

func (eg ActorMigrateInEvent) SetSequenceNumber(num uint64)

func (ActorMigrateInEvent) SetTimestamp

func (eg ActorMigrateInEvent) SetTimestamp(t time.Time)

func (ActorMigrateInEvent) ShouldPersist

func (eg ActorMigrateInEvent) ShouldPersist() bool

func (ActorMigrateInEvent) Timestamp

func (eg ActorMigrateInEvent) Timestamp() time.Time

func (ActorMigrateInEvent) Type

func (eg ActorMigrateInEvent) Type() int

func (ActorMigrateInEvent) Version

func (eg ActorMigrateInEvent) Version() int

type ActorMigrateOutEvent

type ActorMigrateOutEvent struct {
	ActorID           uuid.UUID
	FromLocID         uuid.UUID
	ToLocID, ToZoneID uuid.UUID
	// contains filtered or unexported fields
}

func NewActorMigrateOutEvent

func NewActorMigrateOutEvent(actorID, fromLocID, toLocID, toZoneID, zoneID uuid.UUID) *ActorMigrateOutEvent

func (ActorMigrateOutEvent) AggregateId

func (eg ActorMigrateOutEvent) AggregateId() uuid.UUID

func (ActorMigrateOutEvent) SequenceNumber

func (eg ActorMigrateOutEvent) SequenceNumber() uint64

func (ActorMigrateOutEvent) SetSequenceNumber

func (eg ActorMigrateOutEvent) SetSequenceNumber(num uint64)

func (ActorMigrateOutEvent) SetTimestamp

func (eg ActorMigrateOutEvent) SetTimestamp(t time.Time)

func (ActorMigrateOutEvent) ShouldPersist

func (eg ActorMigrateOutEvent) ShouldPersist() bool

func (ActorMigrateOutEvent) Timestamp

func (eg ActorMigrateOutEvent) Timestamp() time.Time

func (ActorMigrateOutEvent) Type

func (eg ActorMigrateOutEvent) Type() int

func (ActorMigrateOutEvent) Version

func (eg ActorMigrateOutEvent) Version() int

type ActorMoveEvent

type ActorMoveEvent struct {
	FromLocationId uuid.UUID
	ToLocationId   uuid.UUID
	ActorId        uuid.UUID
	// contains filtered or unexported fields
}

func NewActorMoveEvent

func NewActorMoveEvent(fromLocationId, toLocationId, actorId, zoneId uuid.UUID) *ActorMoveEvent

func (ActorMoveEvent) AggregateId

func (eg ActorMoveEvent) AggregateId() uuid.UUID

func (ActorMoveEvent) FromToActorIDs

func (ame ActorMoveEvent) FromToActorIDs() (uuid.UUID, uuid.UUID, uuid.UUID)

func (ActorMoveEvent) SequenceNumber

func (eg ActorMoveEvent) SequenceNumber() uint64

func (ActorMoveEvent) SetSequenceNumber

func (eg ActorMoveEvent) SetSequenceNumber(num uint64)

func (ActorMoveEvent) SetTimestamp

func (eg ActorMoveEvent) SetTimestamp(t time.Time)

func (ActorMoveEvent) ShouldPersist

func (eg ActorMoveEvent) ShouldPersist() bool

func (ActorMoveEvent) Timestamp

func (eg ActorMoveEvent) Timestamp() time.Time

func (ActorMoveEvent) Type

func (eg ActorMoveEvent) Type() int

func (ActorMoveEvent) Version

func (eg ActorMoveEvent) Version() int

type ActorRemoveFromZoneEvent

type ActorRemoveFromZoneEvent struct {
	ActorID uuid.UUID
	// contains filtered or unexported fields
}

func NewActorRemoveFromZoneEvent

func NewActorRemoveFromZoneEvent(actorID, zoneID uuid.UUID) *ActorRemoveFromZoneEvent

func (ActorRemoveFromZoneEvent) AggregateId

func (eg ActorRemoveFromZoneEvent) AggregateId() uuid.UUID

func (ActorRemoveFromZoneEvent) SequenceNumber

func (eg ActorRemoveFromZoneEvent) SequenceNumber() uint64

func (ActorRemoveFromZoneEvent) SetSequenceNumber

func (eg ActorRemoveFromZoneEvent) SetSequenceNumber(num uint64)

func (ActorRemoveFromZoneEvent) SetTimestamp

func (eg ActorRemoveFromZoneEvent) SetTimestamp(t time.Time)

func (ActorRemoveFromZoneEvent) ShouldPersist

func (eg ActorRemoveFromZoneEvent) ShouldPersist() bool

func (ActorRemoveFromZoneEvent) Timestamp

func (eg ActorRemoveFromZoneEvent) Timestamp() time.Time

func (ActorRemoveFromZoneEvent) Type

func (eg ActorRemoveFromZoneEvent) Type() int

func (ActorRemoveFromZoneEvent) Version

func (eg ActorRemoveFromZoneEvent) Version() int

type ActorSpeakEvent

type ActorSpeakEvent struct {
	ActorName string
	ActorID   uuid.UUID
	Speech    string
	// contains filtered or unexported fields
}

func NewActorSpeakEvent

func NewActorSpeakEvent(name, speech string, actorID, zoneID uuid.UUID) *ActorSpeakEvent

func (ActorSpeakEvent) AggregateId

func (eg ActorSpeakEvent) AggregateId() uuid.UUID

func (ActorSpeakEvent) SequenceNumber

func (eg ActorSpeakEvent) SequenceNumber() uint64

func (ActorSpeakEvent) SetSequenceNumber

func (eg ActorSpeakEvent) SetSequenceNumber(num uint64)

func (ActorSpeakEvent) SetTimestamp

func (eg ActorSpeakEvent) SetTimestamp(t time.Time)

func (ActorSpeakEvent) ShouldPersist

func (eg ActorSpeakEvent) ShouldPersist() bool

func (ActorSpeakEvent) Timestamp

func (eg ActorSpeakEvent) Timestamp() time.Time

func (ActorSpeakEvent) Type

func (eg ActorSpeakEvent) Type() int

func (ActorSpeakEvent) Version

func (eg ActorSpeakEvent) Version() int

type AttributeSet

type AttributeSet struct {
	TotalBaseCap int
	// base attributes / caps
	Strength, StrengthCap int
	Fitness, FitnessCap   int
	Will, WillCap         int
	Faith, Faithcap       int
	// derived attributes
	Physical, Stamina, Focus, Zeal int
	// natural combat stats
	NaturalBiteMin, NaturalBiteMax   float64
	NaturalSlashMin, NaturalSlashMax float64
}

type CombatDodgeEvent

type CombatDodgeEvent struct {
	DamageType               string
	AttackerID               uuid.UUID
	TargetID                 uuid.UUID
	AttackerName, TargetName string
	// contains filtered or unexported fields
}

func NewCombatDodgeEvent

func NewCombatDodgeEvent(dmgType, attackerName, targetName string, attackerID, targetID, zoneID uuid.UUID) *CombatDodgeEvent

func (CombatDodgeEvent) AggregateId

func (eg CombatDodgeEvent) AggregateId() uuid.UUID

func (CombatDodgeEvent) SequenceNumber

func (eg CombatDodgeEvent) SequenceNumber() uint64

func (CombatDodgeEvent) SetSequenceNumber

func (eg CombatDodgeEvent) SetSequenceNumber(num uint64)

func (CombatDodgeEvent) SetTimestamp

func (eg CombatDodgeEvent) SetTimestamp(t time.Time)

func (CombatDodgeEvent) ShouldPersist

func (eg CombatDodgeEvent) ShouldPersist() bool

func (CombatDodgeEvent) Timestamp

func (eg CombatDodgeEvent) Timestamp() time.Time

func (CombatDodgeEvent) Type

func (eg CombatDodgeEvent) Type() int

func (CombatDodgeEvent) Version

func (eg CombatDodgeEvent) Version() int

type CombatMeleeDamageEvent

type CombatMeleeDamageEvent struct {
	DamageType                        string
	AttackerID                        uuid.UUID
	TargetID                          uuid.UUID
	AttackerName, TargetName          string
	PhysicalDmg, StaminaDmg, FocusDmg int
	// contains filtered or unexported fields
}

func NewCombatMeleeDamageEvent

func NewCombatMeleeDamageEvent(dmgTyp string, attackerID, targetID, zoneID uuid.UUID, attackerName, targetName string, physDmg, stamDmg, focDmg int) *CombatMeleeDamageEvent

func (CombatMeleeDamageEvent) AggregateId

func (eg CombatMeleeDamageEvent) AggregateId() uuid.UUID

func (CombatMeleeDamageEvent) SequenceNumber

func (eg CombatMeleeDamageEvent) SequenceNumber() uint64

func (CombatMeleeDamageEvent) SetSequenceNumber

func (eg CombatMeleeDamageEvent) SetSequenceNumber(num uint64)

func (CombatMeleeDamageEvent) SetTimestamp

func (eg CombatMeleeDamageEvent) SetTimestamp(t time.Time)

func (CombatMeleeDamageEvent) ShouldPersist

func (eg CombatMeleeDamageEvent) ShouldPersist() bool

func (CombatMeleeDamageEvent) Timestamp

func (eg CombatMeleeDamageEvent) Timestamp() time.Time

func (CombatMeleeDamageEvent) Type

func (eg CombatMeleeDamageEvent) Type() int

func (CombatMeleeDamageEvent) Version

func (eg CombatMeleeDamageEvent) Version() int

type Command

type Command interface {
	CommandType() int
}

type Container

type Container interface {
	ID() uuid.UUID
	Capacity() int
	ContainsObject(o *Object) bool
	SubcontainerFor(o *Object) string
	Objects() ObjectList
	Observers() ObserverList
	Location() *Location
	// contains filtered or unexported methods
}

type DataStore

type DataStore interface {
	RetrieveAllEventsForZone(uuid uuid.UUID) (<-chan rpc.Response, error)
	RetrieveEventsUpToSequenceNumForZone(endNum uint64, zoneID uuid.UUID) (<-chan rpc.Response, error)
	EventPersister
	PersistSnapshot(uuid.UUID, uint64, []Event) error
}

type Event

type Event interface {
	Type() int
	Timestamp() time.Time
	SetTimestamp(t time.Time)
	Version() int
	AggregateId() uuid.UUID
	SequenceNumber() uint64
	SetSequenceNumber(num uint64)
	ShouldPersist() bool
}

type EventPersister

type EventPersister interface {
	PersistEvent(e Event) error
}

type Exit

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

func NewExit

func NewExit(id uuid.UUID, desc, direction string, src, dest *Location, zone *Zone, otherZoneID, otherLocID uuid.UUID) *Exit

func (Exit) Description

func (ex Exit) Description() string

func (Exit) Destination

func (ex Exit) Destination() *Location

func (Exit) Direction

func (ex Exit) Direction() string

func (Exit) ID

func (ex Exit) ID() uuid.UUID

func (Exit) OtherZoneID

func (ex Exit) OtherZoneID() uuid.UUID

func (Exit) OtherZoneLocID

func (ex Exit) OtherZoneLocID() uuid.UUID

func (Exit) Source

func (ex Exit) Source() *Location

func (Exit) Update

func (ex Exit) Update(desc, direction string, source, dest *Location, extZoneID, extLocID uuid.UUID) error

func (Exit) Zone

func (ex Exit) Zone() *Zone

type ExitAddToZoneEvent

type ExitAddToZoneEvent struct {
	ExitID           uuid.UUID
	Description      string
	Direction        string
	SourceLocationId uuid.UUID
	DestZoneID       uuid.UUID
	DestLocationId   uuid.UUID
	// contains filtered or unexported fields
}

func NewExitAddToZoneEvent

func NewExitAddToZoneEvent(desc, direction string, exitId, sourceId, destLocId, srcZoneId, destZoneID uuid.UUID) *ExitAddToZoneEvent

func (ExitAddToZoneEvent) AggregateId

func (eg ExitAddToZoneEvent) AggregateId() uuid.UUID

func (ExitAddToZoneEvent) SequenceNumber

func (eg ExitAddToZoneEvent) SequenceNumber() uint64

func (ExitAddToZoneEvent) SetSequenceNumber

func (eg ExitAddToZoneEvent) SetSequenceNumber(num uint64)

func (ExitAddToZoneEvent) SetTimestamp

func (eg ExitAddToZoneEvent) SetTimestamp(t time.Time)

func (ExitAddToZoneEvent) ShouldPersist

func (eg ExitAddToZoneEvent) ShouldPersist() bool

func (ExitAddToZoneEvent) Timestamp

func (eg ExitAddToZoneEvent) Timestamp() time.Time

func (ExitAddToZoneEvent) Type

func (eg ExitAddToZoneEvent) Type() int

func (ExitAddToZoneEvent) Version

func (eg ExitAddToZoneEvent) Version() int

type ExitList

type ExitList []*Exit

func (ExitList) Copy

func (el ExitList) Copy() ExitList

func (ExitList) IndexOf

func (el ExitList) IndexOf(exit *Exit) (int, error)

func (ExitList) Remove

func (el ExitList) Remove(ex *Exit) ExitList

type ExitRemoveFromZoneEvent

type ExitRemoveFromZoneEvent struct {
	ExitID uuid.UUID
	// contains filtered or unexported fields
}

func NewExitRemoveFromZoneEvent

func NewExitRemoveFromZoneEvent(exitID, zoneID uuid.UUID) *ExitRemoveFromZoneEvent

func (ExitRemoveFromZoneEvent) AggregateId

func (eg ExitRemoveFromZoneEvent) AggregateId() uuid.UUID

func (ExitRemoveFromZoneEvent) SequenceNumber

func (eg ExitRemoveFromZoneEvent) SequenceNumber() uint64

func (ExitRemoveFromZoneEvent) SetSequenceNumber

func (eg ExitRemoveFromZoneEvent) SetSequenceNumber(num uint64)

func (ExitRemoveFromZoneEvent) SetTimestamp

func (eg ExitRemoveFromZoneEvent) SetTimestamp(t time.Time)

func (ExitRemoveFromZoneEvent) ShouldPersist

func (eg ExitRemoveFromZoneEvent) ShouldPersist() bool

func (ExitRemoveFromZoneEvent) Timestamp

func (eg ExitRemoveFromZoneEvent) Timestamp() time.Time

func (ExitRemoveFromZoneEvent) Type

func (eg ExitRemoveFromZoneEvent) Type() int

func (ExitRemoveFromZoneEvent) Version

func (eg ExitRemoveFromZoneEvent) Version() int

type ExitUpdateEvent

type ExitUpdateEvent struct {
	ExitID           uuid.UUID
	Description      string
	Direction        string
	SourceLocationId uuid.UUID
	DestZoneID       uuid.UUID
	DestLocationId   uuid.UUID
	// contains filtered or unexported fields
}

func NewExitUpdateEvent

func NewExitUpdateEvent(desc, direction string, exitID, sourceID, destID, srcZoneID, extZoneID uuid.UUID) *ExitUpdateEvent

func (ExitUpdateEvent) AggregateId

func (eg ExitUpdateEvent) AggregateId() uuid.UUID

func (ExitUpdateEvent) SequenceNumber

func (eg ExitUpdateEvent) SequenceNumber() uint64

func (ExitUpdateEvent) SetSequenceNumber

func (eg ExitUpdateEvent) SetSequenceNumber(num uint64)

func (ExitUpdateEvent) SetTimestamp

func (eg ExitUpdateEvent) SetTimestamp(t time.Time)

func (ExitUpdateEvent) ShouldPersist

func (eg ExitUpdateEvent) ShouldPersist() bool

func (ExitUpdateEvent) Timestamp

func (eg ExitUpdateEvent) Timestamp() time.Time

func (ExitUpdateEvent) Type

func (eg ExitUpdateEvent) Type() int

func (ExitUpdateEvent) Version

func (eg ExitUpdateEvent) Version() int

type IntentLogger

type IntentLogger interface {
	Open(func(redo, undo []Event) error) error
	Close()
	WriteIntent(redo, undo []Event) (uuid.UUID, error)
	ConfirmIntentCompletion(transactionID uuid.UUID) error
}

type Location

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

func NewLocation

func NewLocation(id uuid.UUID, zone *Zone, shortDesc, longDesc string) *Location

func (Location) Actors

func (l Location) Actors() ActorList

func (*Location) Capacity

func (l *Location) Capacity() int

func (*Location) ContainsObject

func (l *Location) ContainsObject(o *Object) bool

func (Location) Description

func (l Location) Description() string

func (Location) ID

func (l Location) ID() uuid.UUID

func (*Location) Location

func (l *Location) Location() *Location

Location() implements the Container interface, by returning the receiver *Location.

func (Location) Objects

func (l Location) Objects() ObjectList

func (Location) Observers

func (l Location) Observers() ObserverList

func (Location) OutExits

func (l Location) OutExits() ExitList

func (Location) ShortDescription

func (l Location) ShortDescription() string

func (*Location) SubcontainerFor

func (l *Location) SubcontainerFor(o *Object) string

func (Location) Tag

func (l Location) Tag() string

func (Location) Update

func (l Location) Update(shortDesc, desc string) error

func (Location) Zone

func (l Location) Zone() *Zone

type LocationAddToZoneEvent

type LocationAddToZoneEvent struct {
	LocationID uuid.UUID
	ShortDesc  string
	Desc       string
	// contains filtered or unexported fields
}

func NewLocationAddToZoneEvent

func NewLocationAddToZoneEvent(shortDesc, desc string, locationId, zoneId uuid.UUID) *LocationAddToZoneEvent

func (LocationAddToZoneEvent) AggregateId

func (eg LocationAddToZoneEvent) AggregateId() uuid.UUID

func (LocationAddToZoneEvent) SequenceNumber

func (eg LocationAddToZoneEvent) SequenceNumber() uint64

func (LocationAddToZoneEvent) SetSequenceNumber

func (eg LocationAddToZoneEvent) SetSequenceNumber(num uint64)

func (LocationAddToZoneEvent) SetTimestamp

func (eg LocationAddToZoneEvent) SetTimestamp(t time.Time)

func (LocationAddToZoneEvent) ShouldPersist

func (eg LocationAddToZoneEvent) ShouldPersist() bool

func (LocationAddToZoneEvent) Timestamp

func (eg LocationAddToZoneEvent) Timestamp() time.Time

func (LocationAddToZoneEvent) Type

func (eg LocationAddToZoneEvent) Type() int

func (LocationAddToZoneEvent) Version

func (eg LocationAddToZoneEvent) Version() int

type LocationList

type LocationList []*Location

func (LocationList) IndexOf

func (ll LocationList) IndexOf(loc *Location) (int, error)

type LocationRemoveFromZoneEvent

type LocationRemoveFromZoneEvent struct {
	LocationID uuid.UUID
	// contains filtered or unexported fields
}

func NewLocationRemoveFromZoneEvent

func NewLocationRemoveFromZoneEvent(locID, zoneID uuid.UUID) *LocationRemoveFromZoneEvent

func (LocationRemoveFromZoneEvent) AggregateId

func (eg LocationRemoveFromZoneEvent) AggregateId() uuid.UUID

func (LocationRemoveFromZoneEvent) SequenceNumber

func (eg LocationRemoveFromZoneEvent) SequenceNumber() uint64

func (LocationRemoveFromZoneEvent) SetSequenceNumber

func (eg LocationRemoveFromZoneEvent) SetSequenceNumber(num uint64)

func (LocationRemoveFromZoneEvent) SetTimestamp

func (eg LocationRemoveFromZoneEvent) SetTimestamp(t time.Time)

func (LocationRemoveFromZoneEvent) ShouldPersist

func (eg LocationRemoveFromZoneEvent) ShouldPersist() bool

func (LocationRemoveFromZoneEvent) Timestamp

func (eg LocationRemoveFromZoneEvent) Timestamp() time.Time

func (LocationRemoveFromZoneEvent) Type

func (eg LocationRemoveFromZoneEvent) Type() int

func (LocationRemoveFromZoneEvent) Version

func (eg LocationRemoveFromZoneEvent) Version() int

type LocationUpdateEvent

type LocationUpdateEvent struct {
	LocationID uuid.UUID
	ShortDesc  string
	Desc       string
	// contains filtered or unexported fields
}

func NewLocationUpdateEvent

func NewLocationUpdateEvent(shortDesc, desc string, locationID, zoneID uuid.UUID) *LocationUpdateEvent

func (LocationUpdateEvent) AggregateId

func (eg LocationUpdateEvent) AggregateId() uuid.UUID

func (LocationUpdateEvent) SequenceNumber

func (eg LocationUpdateEvent) SequenceNumber() uint64

func (LocationUpdateEvent) SetSequenceNumber

func (eg LocationUpdateEvent) SetSequenceNumber(num uint64)

func (LocationUpdateEvent) SetTimestamp

func (eg LocationUpdateEvent) SetTimestamp(t time.Time)

func (LocationUpdateEvent) ShouldPersist

func (eg LocationUpdateEvent) ShouldPersist() bool

func (LocationUpdateEvent) Timestamp

func (eg LocationUpdateEvent) Timestamp() time.Time

func (LocationUpdateEvent) Type

func (eg LocationUpdateEvent) Type() int

func (LocationUpdateEvent) Version

func (eg LocationUpdateEvent) Version() int

type Object

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

func NewObject

func NewObject(id uuid.UUID, name, desc string, keywords []string, container Container, capacity int, zone *Zone, attrs ObjectAttributes) *Object

func (*Object) AdminRelocate

func (o *Object) AdminRelocate(to Container, toSubcontainer string) error

func (*Object) Attributes

func (o *Object) Attributes() ObjectAttributes

func (*Object) Capacity

func (o *Object) Capacity() int

func (Object) Container

func (o Object) Container() Container

func (*Object) ContainsObject

func (o *Object) ContainsObject(object *Object) bool

func (Object) Description

func (o Object) Description() string

func (Object) ID

func (o Object) ID() uuid.UUID

func (Object) InventorySlots

func (o Object) InventorySlots() int

func (Object) Keywords

func (o Object) Keywords() []string

func (*Object) Location

func (o *Object) Location() *Location

func (*Object) Move

func (o *Object) Move(from, to Container, who *Actor, toSubcontainer string) error

func (*Object) MoveToSubcontainer

func (o *Object) MoveToSubcontainer(subcontainer string, actor *Actor) error

func (Object) Name

func (o Object) Name() string

func (*Object) Objects

func (o *Object) Objects() ObjectList

func (*Object) Observers

func (o *Object) Observers() ObserverList

func (*Object) SubcontainerFor

func (o *Object) SubcontainerFor(obj *Object) string

func (*Object) Zone

func (o *Object) Zone() *Zone

type ObjectAddToZoneEvent

type ObjectAddToZoneEvent struct {
	ObjectID                                                 uuid.UUID
	Name, Description                                        string
	Keywords                                                 []string
	LocationContainerID, ActorContainerID, ObjectContainerID uuid.UUID
	Subcontainer                                             string
	Capacity                                                 int
	Attributes                                               ObjectAttributes
	// contains filtered or unexported fields
}

func NewObjectAddToZoneEvent

func NewObjectAddToZoneEvent(name, desc string, keywords []string, capacity int, objectId, locationContainerID, actorContainerID, objectContainerID, zoneId uuid.UUID, subcontainer string, attrs ObjectAttributes) *ObjectAddToZoneEvent

func (ObjectAddToZoneEvent) AggregateId

func (eg ObjectAddToZoneEvent) AggregateId() uuid.UUID

func (ObjectAddToZoneEvent) SequenceNumber

func (eg ObjectAddToZoneEvent) SequenceNumber() uint64

func (ObjectAddToZoneEvent) SetSequenceNumber

func (eg ObjectAddToZoneEvent) SetSequenceNumber(num uint64)

func (ObjectAddToZoneEvent) SetTimestamp

func (eg ObjectAddToZoneEvent) SetTimestamp(t time.Time)

func (ObjectAddToZoneEvent) ShouldPersist

func (eg ObjectAddToZoneEvent) ShouldPersist() bool

func (ObjectAddToZoneEvent) Timestamp

func (eg ObjectAddToZoneEvent) Timestamp() time.Time

func (ObjectAddToZoneEvent) Type

func (eg ObjectAddToZoneEvent) Type() int

func (ObjectAddToZoneEvent) Version

func (eg ObjectAddToZoneEvent) Version() int

type ObjectAdminRelocateEvent

type ObjectAdminRelocateEvent struct {
	ObjectID                                                       uuid.UUID
	ToLocationContainerID, ToActorContainerID, ToObjectContainerID uuid.UUID
	ToSubcontainer                                                 string
	// contains filtered or unexported fields
}

func NewObjectAdminRelocateEvent

func NewObjectAdminRelocateEvent(objectID, zoneID uuid.UUID) *ObjectAdminRelocateEvent

func (ObjectAdminRelocateEvent) AggregateId

func (eg ObjectAdminRelocateEvent) AggregateId() uuid.UUID

func (ObjectAdminRelocateEvent) SequenceNumber

func (eg ObjectAdminRelocateEvent) SequenceNumber() uint64

func (ObjectAdminRelocateEvent) SetSequenceNumber

func (eg ObjectAdminRelocateEvent) SetSequenceNumber(num uint64)

func (ObjectAdminRelocateEvent) SetTimestamp

func (eg ObjectAdminRelocateEvent) SetTimestamp(t time.Time)

func (ObjectAdminRelocateEvent) ShouldPersist

func (eg ObjectAdminRelocateEvent) ShouldPersist() bool

func (ObjectAdminRelocateEvent) Timestamp

func (eg ObjectAdminRelocateEvent) Timestamp() time.Time

func (ObjectAdminRelocateEvent) Type

func (eg ObjectAdminRelocateEvent) Type() int

func (ObjectAdminRelocateEvent) Version

func (eg ObjectAdminRelocateEvent) Version() int

type ObjectAttributes

type ObjectAttributes struct {
	SlashingDamageMin float64
	SlashingDamageMax float64
	StabbingDamageMin float64
	StabbingDamageMax float64
	BashingDamageMin  float64
	BashingDamageMax  float64
}

type ObjectList

type ObjectList []*Object

func (ObjectList) Copy

func (ol ObjectList) Copy() ObjectList

func (ObjectList) IndexOf

func (ol ObjectList) IndexOf(obj *Object) (int, error)

func (ObjectList) Remove

func (ol ObjectList) Remove(object *Object) ObjectList

type ObjectMigrateInEvent

type ObjectMigrateInEvent struct {
	ObjectID                                                 uuid.UUID
	Name, Description                                        string
	Keywords                                                 []string
	FromZoneID                                               uuid.UUID
	LocationContainerID, ActorContainerID, ObjectContainerID uuid.UUID
	Subcontainer                                             string
	Capacity                                                 int
	Attributes                                               ObjectAttributes
	// contains filtered or unexported fields
}

func NewObjectMigrateInEvent

func NewObjectMigrateInEvent(name, desc string, keywords []string, capacity int, objID, fromZoneID, locContainerID, actorContainerID, objContainerID, zoneID uuid.UUID, subcontainer string, attrs ObjectAttributes) *ObjectMigrateInEvent

func (ObjectMigrateInEvent) AggregateId

func (eg ObjectMigrateInEvent) AggregateId() uuid.UUID

func (ObjectMigrateInEvent) SequenceNumber

func (eg ObjectMigrateInEvent) SequenceNumber() uint64

func (ObjectMigrateInEvent) SetSequenceNumber

func (eg ObjectMigrateInEvent) SetSequenceNumber(num uint64)

func (ObjectMigrateInEvent) SetTimestamp

func (eg ObjectMigrateInEvent) SetTimestamp(t time.Time)

func (ObjectMigrateInEvent) ShouldPersist

func (eg ObjectMigrateInEvent) ShouldPersist() bool

func (ObjectMigrateInEvent) Timestamp

func (eg ObjectMigrateInEvent) Timestamp() time.Time

func (ObjectMigrateInEvent) Type

func (eg ObjectMigrateInEvent) Type() int

func (ObjectMigrateInEvent) Version

func (eg ObjectMigrateInEvent) Version() int

type ObjectMigrateOutEvent

type ObjectMigrateOutEvent struct {
	ObjectID uuid.UUID
	Name     string
	ToZoneID uuid.UUID
	// contains filtered or unexported fields
}

func NewObjectMigrateOutEvent

func NewObjectMigrateOutEvent(name string, objID, toZoneID, zoneID uuid.UUID) *ObjectMigrateOutEvent

func (ObjectMigrateOutEvent) AggregateId

func (eg ObjectMigrateOutEvent) AggregateId() uuid.UUID

func (ObjectMigrateOutEvent) SequenceNumber

func (eg ObjectMigrateOutEvent) SequenceNumber() uint64

func (ObjectMigrateOutEvent) SetSequenceNumber

func (eg ObjectMigrateOutEvent) SetSequenceNumber(num uint64)

func (ObjectMigrateOutEvent) SetTimestamp

func (eg ObjectMigrateOutEvent) SetTimestamp(t time.Time)

func (ObjectMigrateOutEvent) ShouldPersist

func (eg ObjectMigrateOutEvent) ShouldPersist() bool

func (ObjectMigrateOutEvent) Timestamp

func (eg ObjectMigrateOutEvent) Timestamp() time.Time

func (ObjectMigrateOutEvent) Type

func (eg ObjectMigrateOutEvent) Type() int

func (ObjectMigrateOutEvent) Version

func (eg ObjectMigrateOutEvent) Version() int

type ObjectMoveEvent

type ObjectMoveEvent struct {
	ObjectID                                                             uuid.UUID
	ActorID                                                              uuid.UUID
	FromLocationContainerID, FromActorContainerID, FromObjectContainerID uuid.UUID
	ToLocationContainerID, ToActorContainerID, ToObjectContainerID       uuid.UUID
	ToSubcontainer                                                       string
	// contains filtered or unexported fields
}

func NewObjectMoveEvent

func NewObjectMoveEvent(objID, actorID, zoneID uuid.UUID) *ObjectMoveEvent

func (ObjectMoveEvent) AggregateId

func (eg ObjectMoveEvent) AggregateId() uuid.UUID

func (ObjectMoveEvent) SequenceNumber

func (eg ObjectMoveEvent) SequenceNumber() uint64

func (ObjectMoveEvent) SetSequenceNumber

func (eg ObjectMoveEvent) SetSequenceNumber(num uint64)

func (ObjectMoveEvent) SetTimestamp

func (eg ObjectMoveEvent) SetTimestamp(t time.Time)

func (ObjectMoveEvent) ShouldPersist

func (eg ObjectMoveEvent) ShouldPersist() bool

func (ObjectMoveEvent) Timestamp

func (eg ObjectMoveEvent) Timestamp() time.Time

func (ObjectMoveEvent) Type

func (eg ObjectMoveEvent) Type() int

func (ObjectMoveEvent) Version

func (eg ObjectMoveEvent) Version() int

type ObjectMoveSubcontainerEvent

type ObjectMoveSubcontainerEvent struct {
	ObjectID                         uuid.UUID
	FromSubcontainer, ToSubcontainer string
	ActorID                          uuid.UUID
	// contains filtered or unexported fields
}

func NewObjectMoveSubcontainerEvent

func NewObjectMoveSubcontainerEvent(objId, actorID, zoneID uuid.UUID, fromSub, toSub string) *ObjectMoveSubcontainerEvent

func (ObjectMoveSubcontainerEvent) AggregateId

func (eg ObjectMoveSubcontainerEvent) AggregateId() uuid.UUID

func (ObjectMoveSubcontainerEvent) SequenceNumber

func (eg ObjectMoveSubcontainerEvent) SequenceNumber() uint64

func (ObjectMoveSubcontainerEvent) SetSequenceNumber

func (eg ObjectMoveSubcontainerEvent) SetSequenceNumber(num uint64)

func (ObjectMoveSubcontainerEvent) SetTimestamp

func (eg ObjectMoveSubcontainerEvent) SetTimestamp(t time.Time)

func (ObjectMoveSubcontainerEvent) ShouldPersist

func (eg ObjectMoveSubcontainerEvent) ShouldPersist() bool

func (ObjectMoveSubcontainerEvent) Timestamp

func (eg ObjectMoveSubcontainerEvent) Timestamp() time.Time

func (ObjectMoveSubcontainerEvent) Type

func (eg ObjectMoveSubcontainerEvent) Type() int

func (ObjectMoveSubcontainerEvent) Version

func (eg ObjectMoveSubcontainerEvent) Version() int

type ObjectRemoveFromZoneEvent

type ObjectRemoveFromZoneEvent struct {
	ObjectID uuid.UUID
	Name     string
	// contains filtered or unexported fields
}

func NewObjectRemoveFromZoneEvent

func NewObjectRemoveFromZoneEvent(name string, objectID, zoneID uuid.UUID) *ObjectRemoveFromZoneEvent

func (ObjectRemoveFromZoneEvent) AggregateId

func (eg ObjectRemoveFromZoneEvent) AggregateId() uuid.UUID

func (ObjectRemoveFromZoneEvent) SequenceNumber

func (eg ObjectRemoveFromZoneEvent) SequenceNumber() uint64

func (ObjectRemoveFromZoneEvent) SetSequenceNumber

func (eg ObjectRemoveFromZoneEvent) SetSequenceNumber(num uint64)

func (ObjectRemoveFromZoneEvent) SetTimestamp

func (eg ObjectRemoveFromZoneEvent) SetTimestamp(t time.Time)

func (ObjectRemoveFromZoneEvent) ShouldPersist

func (eg ObjectRemoveFromZoneEvent) ShouldPersist() bool

func (ObjectRemoveFromZoneEvent) Timestamp

func (eg ObjectRemoveFromZoneEvent) Timestamp() time.Time

func (ObjectRemoveFromZoneEvent) Type

func (eg ObjectRemoveFromZoneEvent) Type() int

func (ObjectRemoveFromZoneEvent) Version

func (eg ObjectRemoveFromZoneEvent) Version() int

type Observer

type Observer interface {
	SendEvent(e Event)
	Evict()
}

type ObserverList

type ObserverList []Observer

func (ObserverList) Copy

func (ol ObserverList) Copy() ObserverList

func (ObserverList) Dedupe

func (ol ObserverList) Dedupe() ObserverList

func (ObserverList) IndexOf

func (ol ObserverList) IndexOf(o Observer) (int, error)

func (ObserverList) Remove

func (ol ObserverList) Remove(o Observer) ObserverList

type Skillset

type Skillset struct {
	// melee attack skills
	Slashing, SlashingCap float64
	Stabbing, StabbingCap float64
	Bashing, BashingCap   float64
	// NPC melee attack skills
	Biting, BitingCap float64

	// melee defense skills
	Dodging, DodgingCap                     float64
	DodgingTechniques, DodgingTechniquesCap int
	Deflecting, DeflectingCap               float64
	Blocking, BlockingCap                   float64

	// magic skills
	Sorcery, SorceryCap         float64
	Mysticism, MysticismCap     float64
	Inscription, InscriptionCap float64
}

type World

type World struct {
	DataStore DataStore
	IntentLog IntentLogger
	// contains filtered or unexported fields
}

func NewWorld

func NewWorld() *World

func (*World) ActorByID

func (w *World) ActorByID(id uuid.UUID) *Actor

func (*World) AddActor

func (w *World) AddActor(a *Actor) (*Actor, error)

func (*World) AddZone

func (w *World) AddZone(z *Zone) error

func (*World) LoadAndStart

func (w *World) LoadAndStart(zoneTags []string, defaultZoneID, defaultLocID uuid.UUID) error

func (*World) LoadZone

func (w *World) LoadZone(zoneTag string) error

LoadZone creates a Zone with the given tag, finds all events in the datastore associated with that tag and replays them into the Zone, and then adds the Zone to the World in a runtime-safe fashion (i.e. this can be called while the World is live).

func (*World) MigrateActor

func (w *World) MigrateActor(a *Actor, fromLoc, toLoc *Location) (*Actor, error)

func (*World) ReplayIntentLog

func (w *World) ReplayIntentLog() error

func (*World) Snapshot

func (w *World) Snapshot() error

func (*World) Stop

func (w *World) Stop()

func (*World) ZoneByID

func (w *World) ZoneByID(id uuid.UUID) *Zone

func (*World) Zones

func (w *World) Zones() []*Zone

type Zone

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

func NewZone

func NewZone(id uuid.UUID, nickname string, persister EventPersister) *Zone

func (*Zone) ActorByID

func (z *Zone) ActorByID(id uuid.UUID) *Actor

func (*Zone) Actors

func (z *Zone) Actors() ActorList

func (*Zone) AddActor

func (z *Zone) AddActor(a *Actor) (*Actor, error)

func (*Zone) AddExit

func (z *Zone) AddExit(ex *Exit) (*Exit, error)

func (*Zone) AddLocation

func (z *Zone) AddLocation(l *Location) (*Location, error)

func (*Zone) AddObject

func (z *Zone) AddObject(o *Object, startingLocation *Location) (*Object, error)

func (*Zone) DefaultLocation

func (z *Zone) DefaultLocation() *Location

func (*Zone) Exits

func (z *Zone) Exits() ExitList

func (*Zone) ExitsToLocation

func (z *Zone) ExitsToLocation(loc *Location) ExitList

func (*Zone) ID

func (z *Zone) ID() uuid.UUID

func (*Zone) LastSequenceNum

func (z *Zone) LastSequenceNum() uint64

func (*Zone) LocationByID

func (z *Zone) LocationByID(id uuid.UUID) *Location

func (*Zone) Locations

func (z *Zone) Locations() LocationList

func (*Zone) MigrateInActor

func (z *Zone) MigrateInActor(a *Actor, fromLoc, toLoc *Location) (*Actor, error)

func (*Zone) MigrateOutActor

func (z *Zone) MigrateOutActor(a *Actor, fromLoc, toLoc *Location) error

func (*Zone) Nickname

func (z *Zone) Nickname() string

func (*Zone) ObjectByID

func (z *Zone) ObjectByID(id uuid.UUID) *Object

func (*Zone) Rand

func (z *Zone) Rand() *rand.Rand

func (*Zone) RemoveActor

func (z *Zone) RemoveActor(a *Actor) error

func (*Zone) RemoveExit

func (z *Zone) RemoveExit(ex *Exit) error

func (*Zone) RemoveLocation

func (z *Zone) RemoveLocation(l *Location) error

func (*Zone) RemoveObject

func (z *Zone) RemoveObject(o *Object) error

func (*Zone) ReplayEvents

func (z *Zone) ReplayEvents(inChan <-chan rpc.Response) error

this is used to rebuild state from an Event store; it is not to be used during normal operations

func (*Zone) SetDefaultLocation

func (z *Zone) SetDefaultLocation(loc *Location) error

func (*Zone) StartCommandProcessing

func (z *Zone) StartCommandProcessing()

func (*Zone) StopCommandProcessing

func (z *Zone) StopCommandProcessing()

func (*Zone) Tag

func (z *Zone) Tag() string

func (*Zone) World

func (z *Zone) World() *World

type ZoneSetDefaultLocationEvent

type ZoneSetDefaultLocationEvent struct {
	LocationID uuid.UUID
	// contains filtered or unexported fields
}

func NewZoneSetDefaultLocationEvent

func NewZoneSetDefaultLocationEvent(locID, zoneID uuid.UUID) *ZoneSetDefaultLocationEvent

func (ZoneSetDefaultLocationEvent) AggregateId

func (eg ZoneSetDefaultLocationEvent) AggregateId() uuid.UUID

func (ZoneSetDefaultLocationEvent) SequenceNumber

func (eg ZoneSetDefaultLocationEvent) SequenceNumber() uint64

func (ZoneSetDefaultLocationEvent) SetSequenceNumber

func (eg ZoneSetDefaultLocationEvent) SetSequenceNumber(num uint64)

func (ZoneSetDefaultLocationEvent) SetTimestamp

func (eg ZoneSetDefaultLocationEvent) SetTimestamp(t time.Time)

func (ZoneSetDefaultLocationEvent) ShouldPersist

func (eg ZoneSetDefaultLocationEvent) ShouldPersist() bool

func (ZoneSetDefaultLocationEvent) Timestamp

func (eg ZoneSetDefaultLocationEvent) Timestamp() time.Time

func (ZoneSetDefaultLocationEvent) Type

func (eg ZoneSetDefaultLocationEvent) Type() int

func (ZoneSetDefaultLocationEvent) Version

func (eg ZoneSetDefaultLocationEvent) Version() int

Jump to

Keyboard shortcuts

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