// <auto-generated>
//  automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace FlatBuffers.Gfbpmcatalog
{

    using global::System;
    using global::FlatBuffers;

    public struct Catalog : IFlatbufferObject
    {
        private Table __p;
        public ByteBuffer ByteBuffer { get { return __p.bb; } }
        public static Catalog GetRootAsCatalog(ByteBuffer _bb) { return GetRootAsCatalog(_bb, new Catalog()); }
        public static Catalog GetRootAsCatalog(ByteBuffer _bb, Catalog obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
        public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
        public Catalog __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

        public Model? Context(int j) { int o = __p.__offset(4); return o != 0 ? (Model?)(new Model()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
        public int ContextLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }

        public static Offset<Catalog> CreateCatalog(FlatBufferBuilder builder,
            VectorOffset ContextOffset = default(VectorOffset))
        {
            builder.StartObject(1);
            Catalog.AddContext(builder, ContextOffset);
            return Catalog.EndCatalog(builder);
        }

        public static void StartCatalog(FlatBufferBuilder builder) { builder.StartObject(1); }
        public static void AddContext(FlatBufferBuilder builder, VectorOffset ContextOffset) { builder.AddOffset(0, ContextOffset.Value, 0); }
        public static VectorOffset CreateContextVector(FlatBufferBuilder builder, Offset<Model>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
        public static VectorOffset CreateContextVectorBlock(FlatBufferBuilder builder, Offset<Model>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
        public static void StartContextVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
        public static Offset<Catalog> EndCatalog(FlatBufferBuilder builder)
        {
            int o = builder.EndObject();
            return new Offset<Catalog>(o);
        }
        public static void FinishCatalogBuffer(FlatBufferBuilder builder, Offset<Catalog> offset) { builder.Finish(offset.Value); }
        public static void FinishSizePrefixedCatalogBuffer(FlatBufferBuilder builder, Offset<Catalog> offset) { builder.FinishSizePrefixed(offset.Value); }
    };

    public struct UnkTable : IFlatbufferObject
    {
        private Table __p;
        public ByteBuffer ByteBuffer { get { return __p.bb; } }
        public static UnkTable GetRootAsUnkTable(ByteBuffer _bb) { return GetRootAsUnkTable(_bb, new UnkTable()); }
        public static UnkTable GetRootAsUnkTable(ByteBuffer _bb, UnkTable obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
        public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
        public UnkTable __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

        public ushort Unk { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }

        public static Offset<UnkTable> CreateUnkTable(FlatBufferBuilder builder,
            ushort unk = 0)
        {
            builder.StartObject(1);
            UnkTable.AddUnk(builder, unk);
            return UnkTable.EndUnkTable(builder);
        }

        public static void StartUnkTable(FlatBufferBuilder builder) { builder.StartObject(1); }
        public static void AddUnk(FlatBufferBuilder builder, ushort unk) { builder.AddUshort(0, unk, 0); }
        public static Offset<UnkTable> EndUnkTable(FlatBufferBuilder builder)
        {
            int o = builder.EndObject();
            return new Offset<UnkTable>(o);
        }
    };

    public struct Model : IFlatbufferObject
    {
        private Table __p;
        public ByteBuffer ByteBuffer { get { return __p.bb; } }
        public static Model GetRootAsModel(ByteBuffer _bb) { return GetRootAsModel(_bb, new Model()); }
        public static Model GetRootAsModel(ByteBuffer _bb, Model obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
        public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
        public Model __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

        public ushort PokemonID { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
        public ushort IsSpecial { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUshort(o + __p.bb_pos) : (ushort)0; } }
        public sbyte IsFemale { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }
        public sbyte IsRare { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetSbyte(o + __p.bb_pos) : (sbyte)0; } }
        public string ModelPath { get { int o = __p.__offset(12); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetModelPathBytes() { return __p.__vector_as_span(12); }
#else
        public ArraySegment<byte>? GetModelPathBytes() { return __p.__vector_as_arraysegment(12); }
#endif
        public byte[] GetModelPathArray() { return __p.__vector_as_array<byte>(12); }
        public string ConfigPath { get { int o = __p.__offset(14); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetConfigPathBytes() { return __p.__vector_as_span(14); }
#else
        public ArraySegment<byte>? GetConfigPathBytes() { return __p.__vector_as_arraysegment(14); }
#endif
        public byte[] GetConfigPathArray() { return __p.__vector_as_array<byte>(14); }
        public string PackageFile { get { int o = __p.__offset(16); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetPackageFileBytes() { return __p.__vector_as_span(16); }
#else
        public ArraySegment<byte>? GetPackageFileBytes() { return __p.__vector_as_arraysegment(16); }
#endif
        public byte[] GetPackageFileArray() { return __p.__vector_as_array<byte>(16); }
        public Animation? Animations(int j) { int o = __p.__offset(18); return o != 0 ? (Animation?)(new Animation()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
        public int AnimationsLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } }

        public static Offset<Model> CreateModel(FlatBufferBuilder builder,
            ushort pokemonID = 0,
            ushort isSpecial = 0,
            sbyte isFemale = 0,
            sbyte isRare = 0,
            StringOffset modelPathOffset = default(StringOffset),
            StringOffset configPathOffset = default(StringOffset),
            StringOffset packageFileOffset = default(StringOffset),
            VectorOffset animationsOffset = default(VectorOffset))
        {
            builder.StartObject(8);
            Model.AddAnimations(builder, animationsOffset);
            Model.AddPackageFile(builder, packageFileOffset);
            Model.AddConfigPath(builder, configPathOffset);
            Model.AddModelPath(builder, modelPathOffset);
            Model.AddIsSpecial(builder, isSpecial);
            Model.AddPokemonID(builder, pokemonID);
            Model.AddIsRare(builder, isRare);
            Model.AddIsFemale(builder, isFemale);
            return Model.EndModel(builder);
        }

        public static void StartModel(FlatBufferBuilder builder) { builder.StartObject(8); }
        public static void AddPokemonID(FlatBufferBuilder builder, ushort pokemonID) { builder.AddUshort(0, pokemonID, 0); }
        public static void AddIsSpecial(FlatBufferBuilder builder, ushort isSpecial) { builder.AddUshort(1, isSpecial, 0); }
        public static void AddIsFemale(FlatBufferBuilder builder, sbyte isFemale) { builder.AddSbyte(2, isFemale, 0); }
        public static void AddIsRare(FlatBufferBuilder builder, sbyte isRare) { builder.AddSbyte(3, isRare, 0); }
        public static void AddModelPath(FlatBufferBuilder builder, StringOffset modelPathOffset) { builder.AddOffset(4, modelPathOffset.Value, 0); }
        public static void AddConfigPath(FlatBufferBuilder builder, StringOffset configPathOffset) { builder.AddOffset(5, configPathOffset.Value, 0); }
        public static void AddPackageFile(FlatBufferBuilder builder, StringOffset packageFileOffset) { builder.AddOffset(6, packageFileOffset.Value, 0); }
        public static void AddAnimations(FlatBufferBuilder builder, VectorOffset animationsOffset) { builder.AddOffset(7, animationsOffset.Value, 0); }
        public static VectorOffset CreateAnimationsVector(FlatBufferBuilder builder, Offset<Animation>[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); }
        public static VectorOffset CreateAnimationsVectorBlock(FlatBufferBuilder builder, Offset<Animation>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
        public static void StartAnimationsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
        public static Offset<Model> EndModel(FlatBufferBuilder builder)
        {
            int o = builder.EndObject();
            return new Offset<Model>(o);
        }
    };

    public struct Animation : IFlatbufferObject
    {
        private Table __p;
        public ByteBuffer ByteBuffer { get { return __p.bb; } }
        public static Animation GetRootAsAnimation(ByteBuffer _bb) { return GetRootAsAnimation(_bb, new Animation()); }
        public static Animation GetRootAsAnimation(ByteBuffer _bb, Animation obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
        public void __init(int _i, ByteBuffer _bb) { __p.bb_pos = _i; __p.bb = _bb; }
        public Animation __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

        public string Type { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetTypeBytes() { return __p.__vector_as_span(4); }
#else
        public ArraySegment<byte>? GetTypeBytes() { return __p.__vector_as_arraysegment(4); }
#endif
        public byte[] GetTypeArray() { return __p.__vector_as_array<byte>(4); }
        public string ConfigPath { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
  public Span<byte> GetConfigPathBytes() { return __p.__vector_as_span(6); }
#else
        public ArraySegment<byte>? GetConfigPathBytes() { return __p.__vector_as_arraysegment(6); }
#endif
        public byte[] GetConfigPathArray() { return __p.__vector_as_array<byte>(6); }

        public static Offset<Animation> CreateAnimation(FlatBufferBuilder builder,
            StringOffset typeOffset = default(StringOffset),
            StringOffset configPathOffset = default(StringOffset))
        {
            builder.StartObject(2);
            Animation.AddConfigPath(builder, configPathOffset);
            Animation.AddType(builder, typeOffset);
            return Animation.EndAnimation(builder);
        }

        public static void StartAnimation(FlatBufferBuilder builder) { builder.StartObject(2); }
        public static void AddType(FlatBufferBuilder builder, StringOffset typeOffset) { builder.AddOffset(0, typeOffset.Value, 0); }
        public static void AddConfigPath(FlatBufferBuilder builder, StringOffset configPathOffset) { builder.AddOffset(1, configPathOffset.Value, 0); }
        public static Offset<Animation> EndAnimation(FlatBufferBuilder builder)
        {
            int o = builder.EndObject();
            return new Offset<Animation>(o);
        }
    };


}
