You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hexmap/server/state/state.pbconv.go

21 lines
334 B

package state
func (x *SyncableStatePB) ToGo() (Synced, error) {
pbMap, err := x.Map.ToGo()
if err != nil {
return Synced{}, err
}
user := x.User.ToGo()
return Synced{
Map: pbMap,
User: user,
}, nil
}
func (s Synced) ToPB() *SyncableStatePB {
return &SyncableStatePB{
Map: s.Map.ToPB(),
User: s.User.ToPB(),
}
}