example

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BnameCashInfoStages   = "stg"
	BnameCashInfoCards    = "cs"
	BnameCashInfoOrderIds = "ois"
)
View Source
const (
	BnameEquipmentId    = "id"
	BnameEquipmentRefId = "rid"
	BnameEquipmentAtk   = "atk"
	BnameEquipmentDef   = "def"
	BnameEquipmentHp    = "hp"
)
View Source
const (
	BnamePlayerUid           = "_id"
	BnamePlayerWallet        = "wlt"
	BnamePlayerEquipments    = "eqm"
	BnamePlayerItems         = "itm"
	BnamePlayerCash          = "cs"
	BnamePlayerUpdateVersion = "_uv"
	BnamePlayerCreateTime    = "_ct"
	BnamePlayerUpdateTime    = "_ut"
)
View Source
const (
	BnameWalletCoinTotal = "ct"
	BnameWalletCoinUsed  = "cu"
	BnameWalletDiamond   = "d"
)

Variables

This section is empty.

Functions

Types

type CashInfo

type CashInfo interface {
	bsonmodel.ObjectModel
	Stages() bsonmodel.IntSimpleMapModel
	Cards() []int
	SetCards(cards []int)
	OrderIds() []string
	SetOrderIds(orderIds []string)
}

func NewCashInfo

func NewCashInfo(parent Player) CashInfo

type Equipment

type Equipment interface {
	bsonmodel.StringObjectMapValueModel
	Id() string
	SetId(id string)
	RefId() int
	SetRefId(refId int)
	Atk() int
	SetAtk(atk int)
	Def() int
	SetDef(def int)
	Hp() int
	SetHp(hp int)
}

func NewEquipment

func NewEquipment() Equipment

type Player

type Player interface {
	bsonmodel.RootModel
	Uid() int
	SetUid(uid int)
	Wallet() Wallet
	Equipments() bsonmodel.StringObjectMapModel
	Equipment(id string) Equipment
	Items() bsonmodel.IntSimpleMapModel
	Cash() CashInfo
	UpdateVersion() int
	SetUpdateVersion(updateVersion int)
	IncreaseUpdateVersion() int
	CreateTime() time.Time
	SetCreateTime(createTime time.Time)
	UpdateTime() time.Time
	SetUpdateTime(updateTime time.Time)
}

func LoadPlayerFromDocument

func LoadPlayerFromDocument(m bson.M) (player Player, err error)

func LoadPlayerFromJsoniter

func LoadPlayerFromJsoniter(any jsoniter.Any) (player Player, err error)

func NewPlayer

func NewPlayer() Player

type Wallet

type Wallet interface {
	bsonmodel.ObjectModel
	CoinTotal() int
	SetCoinTotal(coinTotal int)
	CoinUsed() int
	SetCoinUsed(coinUsed int)
	Coin() int
	Diamond() int
	SetDiamond(diamond int)
}

func NewWallet

func NewWallet(parent Player) Wallet

Jump to

Keyboard shortcuts

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