1// Code generated by the FlatBuffers compiler. DO NOT EDIT. 2 3package Example 4 5import ( 6 "strconv" 7 8 flatbuffers "github.com/google/flatbuffers/go" 9 10 MyGame__Example2 "MyGame/Example2" 11) 12 13type AnyUniqueAliases byte 14 15const ( 16 AnyUniqueAliasesNONE AnyUniqueAliases = 0 17 AnyUniqueAliasesM AnyUniqueAliases = 1 18 AnyUniqueAliasesTS AnyUniqueAliases = 2 19 AnyUniqueAliasesM2 AnyUniqueAliases = 3 20) 21 22var EnumNamesAnyUniqueAliases = map[AnyUniqueAliases]string{ 23 AnyUniqueAliasesNONE: "NONE", 24 AnyUniqueAliasesM: "M", 25 AnyUniqueAliasesTS: "TS", 26 AnyUniqueAliasesM2: "M2", 27} 28 29var EnumValuesAnyUniqueAliases = map[string]AnyUniqueAliases{ 30 "NONE": AnyUniqueAliasesNONE, 31 "M": AnyUniqueAliasesM, 32 "TS": AnyUniqueAliasesTS, 33 "M2": AnyUniqueAliasesM2, 34} 35 36func (v AnyUniqueAliases) String() string { 37 if s, ok := EnumNamesAnyUniqueAliases[v]; ok { 38 return s 39 } 40 return "AnyUniqueAliases(" + strconv.FormatInt(int64(v), 10) + ")" 41} 42 43type AnyUniqueAliasesT struct { 44 Type AnyUniqueAliases 45 Value interface{} 46} 47 48func (t *AnyUniqueAliasesT) Pack(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 49 if t == nil { 50 return 0 51 } 52 switch t.Type { 53 case AnyUniqueAliasesM: 54 return t.Value.(*MonsterT).Pack(builder) 55 case AnyUniqueAliasesTS: 56 return t.Value.(*TestSimpleTableWithEnumT).Pack(builder) 57 case AnyUniqueAliasesM2: 58 return t.Value.(*MyGame__Example2.MonsterT).Pack(builder) 59 } 60 return 0 61} 62 63func (rcv AnyUniqueAliases) UnPack(table flatbuffers.Table) *AnyUniqueAliasesT { 64 switch rcv { 65 case AnyUniqueAliasesM: 66 x := Monster{_tab: table} 67 return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesM, Value: x.UnPack() } 68 case AnyUniqueAliasesTS: 69 x := TestSimpleTableWithEnum{_tab: table} 70 return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesTS, Value: x.UnPack() } 71 case AnyUniqueAliasesM2: 72 x := Monster{_tab: table} 73 return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesM2, Value: x.UnPack() } 74 } 75 return nil 76} 77