item

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetItemPool

func GetItemPool() *sync.Pool

func ReleasePoolItem

func ReleasePoolItem(x interface{})

Types

type EquipBar

type EquipBar struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewEquipBar

func NewEquipBar(owner define.PluginObj) *EquipBar

func (*EquipBar) GetEquipByPos

func (eb *EquipBar) GetEquipByPos(pos int) Item

func (*EquipBar) PutonEquip

func (eb *EquipBar) PutonEquip(i Item) error

func (*EquipBar) TakeoffEquip

func (eb *EquipBar) TakeoffEquip(pos int) error

type Item

type Item interface {
	store.StoreObjector

	GetOptions() *Options
	Entry() *auto.ItemEntry
	EquipEnchantEntry() *auto.EquipEnchantEntry
	GetAttManager() *att.AttManager

	GetEquipObj() int64
	SetEquipObj(int64)

	CalcAtt()
}

func NewItem

func NewItem(opts ...Option) Item

func NewPoolItem

func NewPoolItem() Item

type ItemV1

type ItemV1 struct {
	Options `bson:"inline" json:",inline"`
	// contains filtered or unexported fields
}

func (*ItemV1) AfterLoad

func (i *ItemV1) AfterLoad() error

StoreObjector interface

func (*ItemV1) CalcAtt

func (i *ItemV1) CalcAtt()

func (*ItemV1) Entry

func (i *ItemV1) Entry() *auto.ItemEntry

func (*ItemV1) EquipEnchantEntry

func (i *ItemV1) EquipEnchantEntry() *auto.EquipEnchantEntry

func (*ItemV1) GetAttManager

func (i *ItemV1) GetAttManager() *att.AttManager

func (*ItemV1) GetEquipObj

func (i *ItemV1) GetEquipObj() int64

func (*ItemV1) GetID

func (i *ItemV1) GetID() int64

func (*ItemV1) GetObjID

func (i *ItemV1) GetObjID() int64

func (*ItemV1) GetOptions

func (i *ItemV1) GetOptions() *Options

func (*ItemV1) GetOwnerID

func (i *ItemV1) GetOwnerID() int64

func (*ItemV1) GetStoreIndex

func (i *ItemV1) GetStoreIndex() int64

func (*ItemV1) GetTypeID

func (i *ItemV1) GetTypeID() int

func (*ItemV1) SetEquipObj

func (i *ItemV1) SetEquipObj(obj int64)

type Option

type Option func(*Options)

func Entry

func Entry(entry *auto.ItemEntry) Option

func EquipEnchantEntry

func EquipEnchantEntry(entry *auto.EquipEnchantEntry) Option

func EquipObj

func EquipObj(obj int64) Option

func Id

func Id(id int64) Option

func Num

func Num(n int) Option

func OwnerId

func OwnerId(id int64) Option

func TypeId

func TypeId(id int) Option

type Options

type Options struct {
	Id      int64 `bson:"_id" json:"_id"`
	OwnerId int64 `bson:"owner_id" json:"owner_id"`
	TypeId  int   `bson:"type_id" json:"type_id"`
	Num     int   `bson:"num" json:"num"`

	EquipObj          int64                   `bson:"equip_obj" json:"equip_obj"`
	Entry             *auto.ItemEntry         `bson:"-" json:"-"`
	EquipEnchantEntry *auto.EquipEnchantEntry `bson:"-" json:"-"`
}

item options

func DefaultOptions

func DefaultOptions() Options

Jump to

Keyboard shortcuts

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