2025-06-06 18:31:44 +08:00
|
|
|
package logic
|
|
|
|
|
|
|
|
import "ecs/proto/pb"
|
|
|
|
|
|
|
|
type PlayerTreasure struct {
|
|
|
|
Uid uint64 `bson:"uid" key:"1"`
|
|
|
|
Id uint32 `bson:"id"`
|
2025-06-09 18:33:52 +08:00
|
|
|
Level uint32 `bson:"level"`
|
2025-06-06 18:31:44 +08:00
|
|
|
HeroUid uint64 `bson:"hero_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *PlayerTreasure) BuildMsgTreasure() *pb.Treasure {
|
|
|
|
return &pb.Treasure{
|
|
|
|
Uid: this.Uid,
|
|
|
|
Id: this.Id,
|
|
|
|
HeroUid: this.HeroUid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-06-11 17:00:00 +08:00
|
|
|
func (this *Player) AddTreasures(equipId, nums uint32, logType LogType) bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2025-06-09 18:33:52 +08:00
|
|
|
func (this *Player) BuildMsgTreasureListAck() *pb.TreasureListAck {
|
2025-06-06 18:31:44 +08:00
|
|
|
var list []*pb.Treasure
|
|
|
|
for _, treasure := range this.Treasure {
|
|
|
|
list = append(list, treasure.BuildMsgTreasure())
|
|
|
|
}
|
|
|
|
return &pb.TreasureListAck{TreasureList: list}
|
|
|
|
}
|