mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-25 06:28:39 +00:00
[Go] Add UnPackTo functions (#5598)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
32254b7acd
commit
964365ba69
@@ -15,11 +15,15 @@ func AbilityPack(builder *flatbuffers.Builder, t *AbilityT) flatbuffers.UOffsetT
|
||||
if t == nil { return 0 }
|
||||
return CreateAbility(builder, t.Id, t.Distance)
|
||||
}
|
||||
func (rcv *Ability) UnPackTo(t *AbilityT) {
|
||||
t.Id = rcv.Id()
|
||||
t.Distance = rcv.Distance()
|
||||
}
|
||||
|
||||
func (rcv *Ability) UnPack() *AbilityT {
|
||||
if rcv == nil { return nil }
|
||||
t := &AbilityT{}
|
||||
t.Id = rcv.Id()
|
||||
t.Distance = rcv.Distance()
|
||||
rcv.UnPackTo(t)
|
||||
return t
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user