Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDefinitionId ¶
func CategoriesToString ¶
Types ¶
type CategorySet ¶
func (CategorySet) Add ¶
func (cs CategorySet) Add(c Category)
func (CategorySet) Contains ¶
func (cs CategorySet) Contains(c Category) bool
func (CategorySet) ToInt32List ¶
func (cs CategorySet) ToInt32List() (result []int32)
type Definition ¶
type Definition struct { Aliases []string Categories CategorySet Name string ShortDescription string // description of the object when being used: "a long, green stick" -> "The Beastly Fido picks up the long, green stick." DescriptionOnGround string // description of the object when lying on the ground: "A shiny sword is lying here." ZoneId string WearLocation slot.Location Behaviors behavior.BehaviorSet // contains filtered or unexported fields }
Definition of what it means to be an "object" the "platonic form" of an object, if you will.
There is a definition of the type "ShinySword" which defines the properties of what it means to be a ShinySword. An actual ShinySword lying around is an Instance.
func NewDefinition ¶
func (*Definition) AddCategory ¶
func (d *Definition) AddCategory(cat Category)
func (*Definition) CanEquipWeapon ¶
func (d *Definition) CanEquipWeapon() bool
func (*Definition) CanWear ¶
func (d *Definition) CanWear() bool
func (*Definition) HasAlias ¶
func (d *Definition) HasAlias(target string) bool
func (*Definition) Id ¶
func (d *Definition) Id() string
func (*Definition) Identifier ¶
func (d *Definition) Identifier() string
return only the 'id' part of the Definition
type Instance ¶
type Instance struct { InstanceId uuid.UUID Definition *Definition }
The Instances of the Definitions in the world around you. That ShinySword in your hand has certain properties, some of which were inherited by what it means to be a ShinySword (Definition) and others which have happened to that particular instance (soul-bound to you, made invisible, with some damage to the hilt).
func NewInstance ¶
func NewInstance(defn *Definition) *Instance
func (*Instance) CanEquipWeapon ¶
func (*Instance) IsGettable ¶
type InstanceNotFoundError ¶
type InstanceNotFoundError struct {
Id string
}
func (*InstanceNotFoundError) Error ¶
func (e *InstanceNotFoundError) Error() string
type InstanceNotWeaponError ¶
type InstanceNotWeaponError struct {
Id string
}
func (*InstanceNotWeaponError) Error ¶
func (e *InstanceNotWeaponError) Error() string
type Slots ¶
type Slots struct {
// contains filtered or unexported fields
}
func (*Slots) IsItemInUse ¶
Click to show internal directories.
Click to hide internal directories.