hero

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHeroPool

func GetHeroPool() *sync.Pool

func ReleasePoolHero

func ReleasePoolHero(x interface{})

Types

type Hero

type Hero interface {
	store.StoreObjector

	GetOptions() *Options
	GetEquipBar() *item.EquipBar
	GetAttManager() *att.AttManager
	GetRuneBox() *rune.RuneBox

	AddExp(int64) int64
	AddLevel(int32) int32
	BeforeDelete()
	CalcAtt()
}

func NewHero

func NewHero(opts ...Option) Hero

func NewPoolHero

func NewPoolHero() Hero

type HeroV1

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

func (*HeroV1) AddExp

func (h *HeroV1) AddExp(exp int64) int64

func (*HeroV1) AddLevel

func (h *HeroV1) AddLevel(level int32) int32

func (*HeroV1) AfterLoad

func (h *HeroV1) AfterLoad() error

store.StoreObjector interface

func (*HeroV1) BeforeDelete

func (h *HeroV1) BeforeDelete()

func (*HeroV1) CalcAtt

func (h *HeroV1) CalcAtt()

func (*HeroV1) GetAttManager

func (h *HeroV1) GetAttManager() *att.AttManager

func (*HeroV1) GetEquipBar

func (h *HeroV1) GetEquipBar() *item.EquipBar

func (*HeroV1) GetID

func (h *HeroV1) GetID() int64

func (*HeroV1) GetLevel

func (h *HeroV1) GetLevel() int32

func (*HeroV1) GetObjID

func (h *HeroV1) GetObjID() int64

func (*HeroV1) GetOptions

func (h *HeroV1) GetOptions() *Options

func (*HeroV1) GetRuneBox

func (h *HeroV1) GetRuneBox() *rune.RuneBox

func (*HeroV1) GetStoreIndex

func (h *HeroV1) GetStoreIndex() int64

func (*HeroV1) GetType

func (h *HeroV1) GetType() int32

type Option

type Option func(*Options)

func Entry

func Entry(entry *auto.HeroEntry) Option

func Exp

func Exp(exp int64) Option

func Id

func Id(id int64) Option

func Level

func Level(level int32) Option

func OwnerId

func OwnerId(id int64) Option

func OwnerType

func OwnerType(tp int32) 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"`
	OwnerType int32           `bson:"owner_type" json:"owner_type"`
	TypeId    int             `bson:"type_id" json:"type_id"`
	Exp       int64           `bson:"exp" json:"exp"`
	Level     int32           `bson:"level" json:"level"`
	Entry     *auto.HeroEntry `bson:"-" json:"-"`
}

hero options

func DefaultOptions

func DefaultOptions() Options

Jump to

Keyboard shortcuts

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