37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package logic
|
|
|
|
//type PlayerPlanetCivilization struct {
|
|
// CivilizationId uint32 `bson:"civilization_id"`
|
|
// Id uint32 `bson:"id"`
|
|
//}
|
|
//
|
|
//type PlayerPlanet struct {
|
|
// Id uint32 `bson:"id" key:"1"`
|
|
// Civilizations []*PlayerPlanetCivilization `bson:"civilizations"`
|
|
//}
|
|
//
|
|
//func (this *PlayerPlanet) BuildMsgPlanet() *proto.Planet {
|
|
// var msg = &proto.Planet{Id: this.Id}
|
|
// for _, civilization := range this.Civilizations {
|
|
// msg.CivilizationList = append(msg.CivilizationList, &proto.PlanetCivilization{CivilizationId: civilization.CivilizationId, Id: civilization.Id})
|
|
// }
|
|
// return msg
|
|
//}
|
|
//
|
|
//func (this *PlayerPlanet) FindCivilization(civilizationId uint32) (int, *PlayerPlanetCivilization) {
|
|
// for i, civilization := range this.Civilizations {
|
|
// if civilization.CivilizationId == civilizationId {
|
|
// return i, civilization
|
|
// }
|
|
// }
|
|
// return -1, nil
|
|
//}
|
|
//
|
|
//func (this *Player) BuildMsgPlanetListAck() *proto.MsgPlanetListAck {
|
|
// var list []*proto.Planet
|
|
// for _, planet := range this.Planet {
|
|
// list = append(list, planet.BuildMsgPlanet())
|
|
// }
|
|
// return &proto.MsgPlanetListAck{List: list}
|
|
//}
|