77 lines
2.0 KiB
Go
77 lines
2.0 KiB
Go
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
|
|
|
|
package Example
|
|
|
|
import (
|
|
"strconv"
|
|
|
|
flatbuffers "github.com/google/flatbuffers/go"
|
|
|
|
MyGame__Example2 "MyGame/Example2"
|
|
)
|
|
|
|
type AnyUniqueAliases byte
|
|
|
|
const (
|
|
AnyUniqueAliasesNONE AnyUniqueAliases = 0
|
|
AnyUniqueAliasesM AnyUniqueAliases = 1
|
|
AnyUniqueAliasesTS AnyUniqueAliases = 2
|
|
AnyUniqueAliasesM2 AnyUniqueAliases = 3
|
|
)
|
|
|
|
var EnumNamesAnyUniqueAliases = map[AnyUniqueAliases]string{
|
|
AnyUniqueAliasesNONE: "NONE",
|
|
AnyUniqueAliasesM: "M",
|
|
AnyUniqueAliasesTS: "TS",
|
|
AnyUniqueAliasesM2: "M2",
|
|
}
|
|
|
|
var EnumValuesAnyUniqueAliases = map[string]AnyUniqueAliases{
|
|
"NONE": AnyUniqueAliasesNONE,
|
|
"M": AnyUniqueAliasesM,
|
|
"TS": AnyUniqueAliasesTS,
|
|
"M2": AnyUniqueAliasesM2,
|
|
}
|
|
|
|
func (v AnyUniqueAliases) String() string {
|
|
if s, ok := EnumNamesAnyUniqueAliases[v]; ok {
|
|
return s
|
|
}
|
|
return "AnyUniqueAliases(" + strconv.FormatInt(int64(v), 10) + ")"
|
|
}
|
|
|
|
type AnyUniqueAliasesT struct {
|
|
Type AnyUniqueAliases
|
|
Value interface{}
|
|
}
|
|
|
|
func AnyUniqueAliasesPack(builder *flatbuffers.Builder, t *AnyUniqueAliasesT) flatbuffers.UOffsetT {
|
|
if t == nil {
|
|
return 0
|
|
}
|
|
switch t.Type {
|
|
case AnyUniqueAliasesM:
|
|
return MonsterPack(builder, t.Value.(*MonsterT))
|
|
case AnyUniqueAliasesTS:
|
|
return TestSimpleTableWithEnumPack(builder, t.Value.(*TestSimpleTableWithEnumT))
|
|
case AnyUniqueAliasesM2:
|
|
return MyGame__Example2.MonsterPack(builder, t.Value.(*MyGame__Example2.MonsterT))
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func AnyUniqueAliasesUnPack(t AnyUniqueAliases, table flatbuffers.Table) *AnyUniqueAliasesT {
|
|
switch t {
|
|
case AnyUniqueAliasesM:
|
|
x := Monster{_tab: table}
|
|
return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesM, Value: x.UnPack() }
|
|
case AnyUniqueAliasesTS:
|
|
x := TestSimpleTableWithEnum{_tab: table}
|
|
return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesTS, Value: x.UnPack() }
|
|
case AnyUniqueAliasesM2:
|
|
x := Monster{_tab: table}
|
|
return &AnyUniqueAliasesT{ Type: AnyUniqueAliasesM2, Value: x.UnPack() }
|
|
}
|
|
return nil
|
|
}
|