26 lines
566 B
Go
26 lines
566 B
Go
![]() |
package logic
|
||
|
|
||
|
import "ecs/proto/pb"
|
||
|
|
||
|
type PlayerTreasure struct {
|
||
|
Uid uint64 `bson:"uid" key:"1"`
|
||
|
Id uint32 `bson:"id"`
|
||
|
HeroUid uint64 `bson:"hero_id"`
|
||
|
}
|
||
|
|
||
|
func (this *PlayerTreasure) BuildMsgTreasure() *pb.Treasure {
|
||
|
return &pb.Treasure{
|
||
|
Uid: this.Uid,
|
||
|
Id: this.Id,
|
||
|
HeroUid: this.HeroUid,
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (this *Player) BuildMsgRigTreasureListAck() *pb.TreasureListAck {
|
||
|
var list []*pb.Treasure
|
||
|
for _, treasure := range this.Treasure {
|
||
|
list = append(list, treasure.BuildMsgTreasure())
|
||
|
}
|
||
|
return &pb.TreasureListAck{TreasureList: list}
|
||
|
}
|