Documentation ¶
Index ¶
- Constants
- Variables
- func NewActorDeathCommand(actor *Actor) *actorDeathCommand
- func NewActorSpeakCommand(actor *Actor, speech string) *actorSpeakCommand
- type Actor
- func (a *Actor) AddObserver(o Observer)
- func (a *Actor) AdminRelocate(to *Location) error
- func (a *Actor) Attributes() AttributeSet
- func (a *Actor) Bite(target *Actor) error
- func (a *Actor) BrainType() string
- func (a *Actor) Capacity() int
- func (a *Actor) ContainsObject(o *Object) bool
- func (a *Actor) Die() error
- func (a *Actor) ID() uuid.UUID
- func (a *Actor) Inventory() *ActorInventory
- func (a *Actor) Location() *Location
- func (a *Actor) Move(from, to *Location) error
- func (a *Actor) Name() string
- func (a *Actor) Objects() ObjectList
- func (a *Actor) Observers() ObserverList
- func (a *Actor) RemoveObserver(o Observer)
- func (a *Actor) Skills() Skillset
- func (a *Actor) Slash(target *Actor) error
- func (a *Actor) Speak(speech string) error
- func (a *Actor) SubcontainerFor(o *Object) string
- func (a *Actor) Zone() *Zone
- type ActorAddToZoneEvent
- func (eg ActorAddToZoneEvent) AggregateId() uuid.UUID
- func (eg ActorAddToZoneEvent) SequenceNumber() uint64
- func (eg ActorAddToZoneEvent) SetSequenceNumber(num uint64)
- func (eg ActorAddToZoneEvent) SetTimestamp(t time.Time)
- func (eg ActorAddToZoneEvent) ShouldPersist() bool
- func (eg ActorAddToZoneEvent) Timestamp() time.Time
- func (eg ActorAddToZoneEvent) Type() int
- func (eg ActorAddToZoneEvent) Version() int
- type ActorAdminRelocateEvent
- func (eg ActorAdminRelocateEvent) AggregateId() uuid.UUID
- func (eg ActorAdminRelocateEvent) SequenceNumber() uint64
- func (eg ActorAdminRelocateEvent) SetSequenceNumber(num uint64)
- func (eg ActorAdminRelocateEvent) SetTimestamp(t time.Time)
- func (eg ActorAdminRelocateEvent) ShouldPersist() bool
- func (eg ActorAdminRelocateEvent) Timestamp() time.Time
- func (eg ActorAdminRelocateEvent) Type() int
- func (eg ActorAdminRelocateEvent) Version() int
- type ActorDeathEvent
- func (eg ActorDeathEvent) AggregateId() uuid.UUID
- func (eg ActorDeathEvent) SequenceNumber() uint64
- func (eg ActorDeathEvent) SetSequenceNumber(num uint64)
- func (eg ActorDeathEvent) SetTimestamp(t time.Time)
- func (eg ActorDeathEvent) ShouldPersist() bool
- func (eg ActorDeathEvent) Timestamp() time.Time
- func (eg ActorDeathEvent) Type() int
- func (eg ActorDeathEvent) Version() int
- type ActorInventory
- func (ai *ActorInventory) Capacity() int
- func (ai *ActorInventory) CapacityBySubcontainer(subname string) (int, int)
- func (ai *ActorInventory) Constraints() ActorInventoryConstraints
- func (ai *ActorInventory) ContainsObject(o *Object) bool
- func (ai *ActorInventory) Objects() ObjectList
- func (ai *ActorInventory) ObjectsBySubcontainer(subname string) ObjectList
- func (ai *ActorInventory) SubcontainerFor(o *Object) string
- type ActorInventoryConstraints
- type ActorList
- type ActorMigrateInEvent
- func (eg ActorMigrateInEvent) AggregateId() uuid.UUID
- func (eg ActorMigrateInEvent) SequenceNumber() uint64
- func (eg ActorMigrateInEvent) SetSequenceNumber(num uint64)
- func (eg ActorMigrateInEvent) SetTimestamp(t time.Time)
- func (eg ActorMigrateInEvent) ShouldPersist() bool
- func (eg ActorMigrateInEvent) Timestamp() time.Time
- func (eg ActorMigrateInEvent) Type() int
- func (eg ActorMigrateInEvent) Version() int
- type ActorMigrateOutEvent
- func (eg ActorMigrateOutEvent) AggregateId() uuid.UUID
- func (eg ActorMigrateOutEvent) SequenceNumber() uint64
- func (eg ActorMigrateOutEvent) SetSequenceNumber(num uint64)
- func (eg ActorMigrateOutEvent) SetTimestamp(t time.Time)
- func (eg ActorMigrateOutEvent) ShouldPersist() bool
- func (eg ActorMigrateOutEvent) Timestamp() time.Time
- func (eg ActorMigrateOutEvent) Type() int
- func (eg ActorMigrateOutEvent) Version() int
- type ActorMoveEvent
- func (eg ActorMoveEvent) AggregateId() uuid.UUID
- func (ame ActorMoveEvent) FromToActorIDs() (uuid.UUID, uuid.UUID, uuid.UUID)
- func (eg ActorMoveEvent) SequenceNumber() uint64
- func (eg ActorMoveEvent) SetSequenceNumber(num uint64)
- func (eg ActorMoveEvent) SetTimestamp(t time.Time)
- func (eg ActorMoveEvent) ShouldPersist() bool
- func (eg ActorMoveEvent) Timestamp() time.Time
- func (eg ActorMoveEvent) Type() int
- func (eg ActorMoveEvent) Version() int
- type ActorRemoveFromZoneEvent
- func (eg ActorRemoveFromZoneEvent) AggregateId() uuid.UUID
- func (eg ActorRemoveFromZoneEvent) SequenceNumber() uint64
- func (eg ActorRemoveFromZoneEvent) SetSequenceNumber(num uint64)
- func (eg ActorRemoveFromZoneEvent) SetTimestamp(t time.Time)
- func (eg ActorRemoveFromZoneEvent) ShouldPersist() bool
- func (eg ActorRemoveFromZoneEvent) Timestamp() time.Time
- func (eg ActorRemoveFromZoneEvent) Type() int
- func (eg ActorRemoveFromZoneEvent) Version() int
- type ActorSpeakEvent
- func (eg ActorSpeakEvent) AggregateId() uuid.UUID
- func (eg ActorSpeakEvent) SequenceNumber() uint64
- func (eg ActorSpeakEvent) SetSequenceNumber(num uint64)
- func (eg ActorSpeakEvent) SetTimestamp(t time.Time)
- func (eg ActorSpeakEvent) ShouldPersist() bool
- func (eg ActorSpeakEvent) Timestamp() time.Time
- func (eg ActorSpeakEvent) Type() int
- func (eg ActorSpeakEvent) Version() int
- type AttributeSet
- type CombatDodgeEvent
- func (eg CombatDodgeEvent) AggregateId() uuid.UUID
- func (eg CombatDodgeEvent) SequenceNumber() uint64
- func (eg CombatDodgeEvent) SetSequenceNumber(num uint64)
- func (eg CombatDodgeEvent) SetTimestamp(t time.Time)
- func (eg CombatDodgeEvent) ShouldPersist() bool
- func (eg CombatDodgeEvent) Timestamp() time.Time
- func (eg CombatDodgeEvent) Type() int
- func (eg CombatDodgeEvent) Version() int
- type CombatMeleeDamageEvent
- func (eg CombatMeleeDamageEvent) AggregateId() uuid.UUID
- func (eg CombatMeleeDamageEvent) SequenceNumber() uint64
- func (eg CombatMeleeDamageEvent) SetSequenceNumber(num uint64)
- func (eg CombatMeleeDamageEvent) SetTimestamp(t time.Time)
- func (eg CombatMeleeDamageEvent) ShouldPersist() bool
- func (eg CombatMeleeDamageEvent) Timestamp() time.Time
- func (eg CombatMeleeDamageEvent) Type() int
- func (eg CombatMeleeDamageEvent) Version() int
- type Command
- type Container
- type DataStore
- type Event
- type EventPersister
- type Exit
- func (ex Exit) Description() string
- func (ex Exit) Destination() *Location
- func (ex Exit) Direction() string
- func (ex Exit) ID() uuid.UUID
- func (ex Exit) OtherZoneID() uuid.UUID
- func (ex Exit) OtherZoneLocID() uuid.UUID
- func (ex Exit) Source() *Location
- func (ex Exit) Update(desc, direction string, source, dest *Location, extZoneID, extLocID uuid.UUID) error
- func (ex Exit) Zone() *Zone
- type ExitAddToZoneEvent
- func (eg ExitAddToZoneEvent) AggregateId() uuid.UUID
- func (eg ExitAddToZoneEvent) SequenceNumber() uint64
- func (eg ExitAddToZoneEvent) SetSequenceNumber(num uint64)
- func (eg ExitAddToZoneEvent) SetTimestamp(t time.Time)
- func (eg ExitAddToZoneEvent) ShouldPersist() bool
- func (eg ExitAddToZoneEvent) Timestamp() time.Time
- func (eg ExitAddToZoneEvent) Type() int
- func (eg ExitAddToZoneEvent) Version() int
- type ExitList
- type ExitRemoveFromZoneEvent
- func (eg ExitRemoveFromZoneEvent) AggregateId() uuid.UUID
- func (eg ExitRemoveFromZoneEvent) SequenceNumber() uint64
- func (eg ExitRemoveFromZoneEvent) SetSequenceNumber(num uint64)
- func (eg ExitRemoveFromZoneEvent) SetTimestamp(t time.Time)
- func (eg ExitRemoveFromZoneEvent) ShouldPersist() bool
- func (eg ExitRemoveFromZoneEvent) Timestamp() time.Time
- func (eg ExitRemoveFromZoneEvent) Type() int
- func (eg ExitRemoveFromZoneEvent) Version() int
- type ExitUpdateEvent
- func (eg ExitUpdateEvent) AggregateId() uuid.UUID
- func (eg ExitUpdateEvent) SequenceNumber() uint64
- func (eg ExitUpdateEvent) SetSequenceNumber(num uint64)
- func (eg ExitUpdateEvent) SetTimestamp(t time.Time)
- func (eg ExitUpdateEvent) ShouldPersist() bool
- func (eg ExitUpdateEvent) Timestamp() time.Time
- func (eg ExitUpdateEvent) Type() int
- func (eg ExitUpdateEvent) Version() int
- type IntentLogger
- type Location
- func (l Location) Actors() ActorList
- func (l *Location) Capacity() int
- func (l *Location) ContainsObject(o *Object) bool
- func (l Location) Description() string
- func (l Location) ID() uuid.UUID
- func (l *Location) Location() *Location
- func (l Location) Objects() ObjectList
- func (l Location) Observers() ObserverList
- func (l Location) OutExits() ExitList
- func (l Location) ShortDescription() string
- func (l *Location) SubcontainerFor(o *Object) string
- func (l Location) Tag() string
- func (l Location) Update(shortDesc, desc string) error
- func (l Location) Zone() *Zone
- type LocationAddToZoneEvent
- func (eg LocationAddToZoneEvent) AggregateId() uuid.UUID
- func (eg LocationAddToZoneEvent) SequenceNumber() uint64
- func (eg LocationAddToZoneEvent) SetSequenceNumber(num uint64)
- func (eg LocationAddToZoneEvent) SetTimestamp(t time.Time)
- func (eg LocationAddToZoneEvent) ShouldPersist() bool
- func (eg LocationAddToZoneEvent) Timestamp() time.Time
- func (eg LocationAddToZoneEvent) Type() int
- func (eg LocationAddToZoneEvent) Version() int
- type LocationList
- type LocationRemoveFromZoneEvent
- func (eg LocationRemoveFromZoneEvent) AggregateId() uuid.UUID
- func (eg LocationRemoveFromZoneEvent) SequenceNumber() uint64
- func (eg LocationRemoveFromZoneEvent) SetSequenceNumber(num uint64)
- func (eg LocationRemoveFromZoneEvent) SetTimestamp(t time.Time)
- func (eg LocationRemoveFromZoneEvent) ShouldPersist() bool
- func (eg LocationRemoveFromZoneEvent) Timestamp() time.Time
- func (eg LocationRemoveFromZoneEvent) Type() int
- func (eg LocationRemoveFromZoneEvent) Version() int
- type LocationUpdateEvent
- func (eg LocationUpdateEvent) AggregateId() uuid.UUID
- func (eg LocationUpdateEvent) SequenceNumber() uint64
- func (eg LocationUpdateEvent) SetSequenceNumber(num uint64)
- func (eg LocationUpdateEvent) SetTimestamp(t time.Time)
- func (eg LocationUpdateEvent) ShouldPersist() bool
- func (eg LocationUpdateEvent) Timestamp() time.Time
- func (eg LocationUpdateEvent) Type() int
- func (eg LocationUpdateEvent) Version() int
- type Object
- func (o *Object) AdminRelocate(to Container, toSubcontainer string) error
- func (o *Object) Attributes() ObjectAttributes
- func (o *Object) Capacity() int
- func (o Object) Container() Container
- func (o *Object) ContainsObject(object *Object) bool
- func (o Object) Description() string
- func (o Object) ID() uuid.UUID
- func (o Object) InventorySlots() int
- func (o Object) Keywords() []string
- func (o *Object) Location() *Location
- func (o *Object) Move(from, to Container, who *Actor, toSubcontainer string) error
- func (o *Object) MoveToSubcontainer(subcontainer string, actor *Actor) error
- func (o Object) Name() string
- func (o *Object) Objects() ObjectList
- func (o *Object) Observers() ObserverList
- func (o *Object) SubcontainerFor(obj *Object) string
- func (o *Object) Zone() *Zone
- type ObjectAddToZoneEvent
- func (eg ObjectAddToZoneEvent) AggregateId() uuid.UUID
- func (eg ObjectAddToZoneEvent) SequenceNumber() uint64
- func (eg ObjectAddToZoneEvent) SetSequenceNumber(num uint64)
- func (eg ObjectAddToZoneEvent) SetTimestamp(t time.Time)
- func (eg ObjectAddToZoneEvent) ShouldPersist() bool
- func (eg ObjectAddToZoneEvent) Timestamp() time.Time
- func (eg ObjectAddToZoneEvent) Type() int
- func (eg ObjectAddToZoneEvent) Version() int
- type ObjectAdminRelocateEvent
- func (eg ObjectAdminRelocateEvent) AggregateId() uuid.UUID
- func (eg ObjectAdminRelocateEvent) SequenceNumber() uint64
- func (eg ObjectAdminRelocateEvent) SetSequenceNumber(num uint64)
- func (eg ObjectAdminRelocateEvent) SetTimestamp(t time.Time)
- func (eg ObjectAdminRelocateEvent) ShouldPersist() bool
- func (eg ObjectAdminRelocateEvent) Timestamp() time.Time
- func (eg ObjectAdminRelocateEvent) Type() int
- func (eg ObjectAdminRelocateEvent) Version() int
- type ObjectAttributes
- type ObjectList
- type ObjectMigrateInEvent
- func (eg ObjectMigrateInEvent) AggregateId() uuid.UUID
- func (eg ObjectMigrateInEvent) SequenceNumber() uint64
- func (eg ObjectMigrateInEvent) SetSequenceNumber(num uint64)
- func (eg ObjectMigrateInEvent) SetTimestamp(t time.Time)
- func (eg ObjectMigrateInEvent) ShouldPersist() bool
- func (eg ObjectMigrateInEvent) Timestamp() time.Time
- func (eg ObjectMigrateInEvent) Type() int
- func (eg ObjectMigrateInEvent) Version() int
- type ObjectMigrateOutEvent
- func (eg ObjectMigrateOutEvent) AggregateId() uuid.UUID
- func (eg ObjectMigrateOutEvent) SequenceNumber() uint64
- func (eg ObjectMigrateOutEvent) SetSequenceNumber(num uint64)
- func (eg ObjectMigrateOutEvent) SetTimestamp(t time.Time)
- func (eg ObjectMigrateOutEvent) ShouldPersist() bool
- func (eg ObjectMigrateOutEvent) Timestamp() time.Time
- func (eg ObjectMigrateOutEvent) Type() int
- func (eg ObjectMigrateOutEvent) Version() int
- type ObjectMoveEvent
- func (eg ObjectMoveEvent) AggregateId() uuid.UUID
- func (eg ObjectMoveEvent) SequenceNumber() uint64
- func (eg ObjectMoveEvent) SetSequenceNumber(num uint64)
- func (eg ObjectMoveEvent) SetTimestamp(t time.Time)
- func (eg ObjectMoveEvent) ShouldPersist() bool
- func (eg ObjectMoveEvent) Timestamp() time.Time
- func (eg ObjectMoveEvent) Type() int
- func (eg ObjectMoveEvent) Version() int
- type ObjectMoveSubcontainerEvent
- func (eg ObjectMoveSubcontainerEvent) AggregateId() uuid.UUID
- func (eg ObjectMoveSubcontainerEvent) SequenceNumber() uint64
- func (eg ObjectMoveSubcontainerEvent) SetSequenceNumber(num uint64)
- func (eg ObjectMoveSubcontainerEvent) SetTimestamp(t time.Time)
- func (eg ObjectMoveSubcontainerEvent) ShouldPersist() bool
- func (eg ObjectMoveSubcontainerEvent) Timestamp() time.Time
- func (eg ObjectMoveSubcontainerEvent) Type() int
- func (eg ObjectMoveSubcontainerEvent) Version() int
- type ObjectRemoveFromZoneEvent
- func (eg ObjectRemoveFromZoneEvent) AggregateId() uuid.UUID
- func (eg ObjectRemoveFromZoneEvent) SequenceNumber() uint64
- func (eg ObjectRemoveFromZoneEvent) SetSequenceNumber(num uint64)
- func (eg ObjectRemoveFromZoneEvent) SetTimestamp(t time.Time)
- func (eg ObjectRemoveFromZoneEvent) ShouldPersist() bool
- func (eg ObjectRemoveFromZoneEvent) Timestamp() time.Time
- func (eg ObjectRemoveFromZoneEvent) Type() int
- func (eg ObjectRemoveFromZoneEvent) Version() int
- type Observer
- type ObserverList
- type Skillset
- type World
- func (w *World) ActorByID(id uuid.UUID) *Actor
- func (w *World) AddActor(a *Actor) (*Actor, error)
- func (w *World) AddZone(z *Zone) error
- func (w *World) LoadAndStart(zoneTags []string, defaultZoneID, defaultLocID uuid.UUID) error
- func (w *World) LoadZone(zoneTag string) error
- func (w *World) MigrateActor(a *Actor, fromLoc, toLoc *Location) (*Actor, error)
- func (w *World) ReplayIntentLog() error
- func (w *World) Snapshot() error
- func (w *World) Stop()
- func (w *World) ZoneByID(id uuid.UUID) *Zone
- func (w *World) Zones() []*Zone
- type Zone
- func (z *Zone) ActorByID(id uuid.UUID) *Actor
- func (z *Zone) Actors() ActorList
- func (z *Zone) AddActor(a *Actor) (*Actor, error)
- func (z *Zone) AddExit(ex *Exit) (*Exit, error)
- func (z *Zone) AddLocation(l *Location) (*Location, error)
- func (z *Zone) AddObject(o *Object, startingLocation *Location) (*Object, error)
- func (z *Zone) DefaultLocation() *Location
- func (z *Zone) Exits() ExitList
- func (z *Zone) ExitsToLocation(loc *Location) ExitList
- func (z *Zone) ID() uuid.UUID
- func (z *Zone) LastSequenceNum() uint64
- func (z *Zone) LocationByID(id uuid.UUID) *Location
- func (z *Zone) Locations() LocationList
- func (z *Zone) MigrateInActor(a *Actor, fromLoc, toLoc *Location) (*Actor, error)
- func (z *Zone) MigrateOutActor(a *Actor, fromLoc, toLoc *Location) error
- func (z *Zone) Nickname() string
- func (z *Zone) ObjectByID(id uuid.UUID) *Object
- func (z *Zone) Rand() *rand.Rand
- func (z *Zone) RemoveActor(a *Actor) error
- func (z *Zone) RemoveExit(ex *Exit) error
- func (z *Zone) RemoveLocation(l *Location) error
- func (z *Zone) RemoveObject(o *Object) error
- func (z *Zone) ReplayEvents(inChan <-chan rpc.Response) error
- func (z *Zone) SetDefaultLocation(loc *Location) error
- func (z *Zone) StartCommandProcessing()
- func (z *Zone) StopCommandProcessing()
- func (z *Zone) Tag() string
- func (z *Zone) World() *World
- type ZoneSetDefaultLocationEvent
- func (eg ZoneSetDefaultLocationEvent) AggregateId() uuid.UUID
- func (eg ZoneSetDefaultLocationEvent) SequenceNumber() uint64
- func (eg ZoneSetDefaultLocationEvent) SetSequenceNumber(num uint64)
- func (eg ZoneSetDefaultLocationEvent) SetTimestamp(t time.Time)
- func (eg ZoneSetDefaultLocationEvent) ShouldPersist() bool
- func (eg ZoneSetDefaultLocationEvent) Timestamp() time.Time
- func (eg ZoneSetDefaultLocationEvent) Type() int
- func (eg ZoneSetDefaultLocationEvent) Version() int
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 AllActorInventorySubcontainers = []string{ InventoryContainerBack, InventoryContainerBelt, InventoryContainerBody, InventoryContainerHands, }
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, }
View Source
var ValidDirections = map[string]bool{ ExitDirectionNorth: true, ExitDirectionSouth: true, ExitDirectionEast: true, ExitDirectionWest: true, }
Functions ¶
func NewActorDeathCommand ¶
func NewActorDeathCommand(actor *Actor) *actorDeathCommand
func NewActorSpeakCommand ¶
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 (*Actor) AdminRelocate ¶
func (*Actor) Attributes ¶
func (a *Actor) Attributes() AttributeSet
func (*Actor) ContainsObject ¶
func (*Actor) Inventory ¶
func (a *Actor) Inventory() *ActorInventory
func (*Actor) Objects ¶
func (a *Actor) Objects() ObjectList
func (*Actor) Observers ¶
func (a *Actor) Observers() ObserverList
func (*Actor) RemoveObserver ¶
func (*Actor) SubcontainerFor ¶
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 (ActorAddToZoneEvent) ShouldPersist ¶
func (eg ActorAddToZoneEvent) ShouldPersist() bool
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 (ActorAdminRelocateEvent) ShouldPersist ¶
func (eg ActorAdminRelocateEvent) ShouldPersist() bool
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 (ActorDeathEvent) ShouldPersist ¶
func (eg ActorDeathEvent) ShouldPersist() bool
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 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 (ActorMigrateInEvent) ShouldPersist ¶
func (eg ActorMigrateInEvent) ShouldPersist() bool
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 (ActorMigrateOutEvent) ShouldPersist ¶
func (eg ActorMigrateOutEvent) ShouldPersist() bool
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 (ActorMoveEvent) ShouldPersist ¶
func (eg ActorMoveEvent) ShouldPersist() bool
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 (ActorRemoveFromZoneEvent) ShouldPersist ¶
func (eg ActorRemoveFromZoneEvent) ShouldPersist() bool
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 (ActorSpeakEvent) ShouldPersist ¶
func (eg ActorSpeakEvent) ShouldPersist() bool
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 (CombatDodgeEvent) ShouldPersist ¶
func (eg CombatDodgeEvent) ShouldPersist() bool
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 (CombatMeleeDamageEvent) ShouldPersist ¶
func (eg CombatMeleeDamageEvent) ShouldPersist() bool
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 EventPersister ¶
type Exit ¶
type Exit struct {
// contains filtered or unexported fields
}
func (Exit) Description ¶
func (Exit) Destination ¶
func (Exit) OtherZoneID ¶
func (ex Exit) OtherZoneID() uuid.UUID
func (Exit) OtherZoneLocID ¶
func (ex Exit) OtherZoneLocID() uuid.UUID
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 (ExitAddToZoneEvent) ShouldPersist ¶
func (eg ExitAddToZoneEvent) ShouldPersist() bool
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 (ExitRemoveFromZoneEvent) ShouldPersist ¶
func (eg ExitRemoveFromZoneEvent) ShouldPersist() bool
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 (ExitUpdateEvent) ShouldPersist ¶
func (eg ExitUpdateEvent) ShouldPersist() bool
type IntentLogger ¶
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
func NewLocation ¶
func (*Location) ContainsObject ¶
func (Location) Description ¶
func (*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) ShortDescription ¶
func (*Location) SubcontainerFor ¶
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 (LocationAddToZoneEvent) ShouldPersist ¶
func (eg LocationAddToZoneEvent) ShouldPersist() bool
type LocationList ¶
type LocationList []*Location
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 (LocationRemoveFromZoneEvent) ShouldPersist ¶
func (eg LocationRemoveFromZoneEvent) ShouldPersist() bool
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 (LocationUpdateEvent) ShouldPersist ¶
func (eg LocationUpdateEvent) ShouldPersist() bool
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (*Object) AdminRelocate ¶
func (*Object) Attributes ¶
func (o *Object) Attributes() ObjectAttributes
func (*Object) ContainsObject ¶
func (Object) Description ¶
func (Object) InventorySlots ¶
func (*Object) MoveToSubcontainer ¶
func (*Object) Objects ¶
func (o *Object) Objects() ObjectList
func (*Object) Observers ¶
func (o *Object) Observers() ObserverList
func (*Object) SubcontainerFor ¶
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 (ObjectAddToZoneEvent) ShouldPersist ¶
func (eg ObjectAddToZoneEvent) ShouldPersist() bool
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 (ObjectAdminRelocateEvent) ShouldPersist ¶
func (eg ObjectAdminRelocateEvent) ShouldPersist() bool
type ObjectAttributes ¶
type ObjectList ¶
type ObjectList []*Object
func (ObjectList) Copy ¶
func (ol ObjectList) Copy() ObjectList
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 (ObjectMigrateInEvent) ShouldPersist ¶
func (eg ObjectMigrateInEvent) ShouldPersist() bool
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 (ObjectMigrateOutEvent) ShouldPersist ¶
func (eg ObjectMigrateOutEvent) ShouldPersist() bool
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 (ObjectMoveEvent) ShouldPersist ¶
func (eg ObjectMoveEvent) ShouldPersist() bool
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 (ObjectMoveSubcontainerEvent) ShouldPersist ¶
func (eg ObjectMoveSubcontainerEvent) ShouldPersist() bool
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 (ObjectRemoveFromZoneEvent) ShouldPersist ¶
func (eg ObjectRemoveFromZoneEvent) ShouldPersist() bool
type ObserverList ¶
type ObserverList []Observer
func (ObserverList) Copy ¶
func (ol ObserverList) Copy() ObserverList
func (ObserverList) Dedupe ¶
func (ol ObserverList) Dedupe() ObserverList
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 (*World) LoadAndStart ¶
func (*World) LoadZone ¶
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 (*World) ReplayIntentLog ¶
type Zone ¶
type Zone struct {
// contains filtered or unexported fields
}
func NewZone ¶
func NewZone(id uuid.UUID, nickname string, persister EventPersister) *Zone
func (*Zone) DefaultLocation ¶
func (*Zone) ExitsToLocation ¶
func (*Zone) LastSequenceNum ¶
func (*Zone) LocationByID ¶
func (*Zone) Locations ¶
func (z *Zone) Locations() LocationList
func (*Zone) MigrateInActor ¶
func (*Zone) MigrateOutActor ¶
func (*Zone) ObjectByID ¶
func (*Zone) RemoveActor ¶
func (*Zone) RemoveExit ¶
func (*Zone) RemoveLocation ¶
func (*Zone) RemoveObject ¶
func (*Zone) ReplayEvents ¶
this is used to rebuild state from an Event store; it is not to be used during normal operations
func (*Zone) SetDefaultLocation ¶
func (*Zone) StartCommandProcessing ¶
func (z *Zone) StartCommandProcessing()
func (*Zone) StopCommandProcessing ¶
func (z *Zone) StopCommandProcessing()
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 (ZoneSetDefaultLocationEvent) ShouldPersist ¶
func (eg ZoneSetDefaultLocationEvent) ShouldPersist() bool
Click to show internal directories.
Click to hide internal directories.