// // automatically generated by the FlatBuffers compiler, do not modify // namespace SCHALE.Common.FlatData { using global::System; using global::System.Collections.Generic; using global::SCHALE.Common.Crypto; using global::Google.FlatBuffers; public struct RootMotionFlat : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static RootMotionFlat GetRootAsRootMotionFlat(ByteBuffer _bb) { return GetRootAsRootMotionFlat(_bb, new RootMotionFlat()); } public static RootMotionFlat GetRootAsRootMotionFlat(ByteBuffer _bb, RootMotionFlat obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public RootMotionFlat __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public SCHALE.Common.FlatData.Form? Forms(int j) { int o = __p.__offset(4); return o != 0 ? (SCHALE.Common.FlatData.Form?)(new SCHALE.Common.FlatData.Form()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; } public int FormsLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } } public SCHALE.Common.FlatData.Motion? ExSkills(int j) { int o = __p.__offset(6); return o != 0 ? (SCHALE.Common.FlatData.Motion?)(new SCHALE.Common.FlatData.Motion()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; } public int ExSkillsLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } } public SCHALE.Common.FlatData.Motion? MoveLeft { get { int o = __p.__offset(8); return o != 0 ? (SCHALE.Common.FlatData.Motion?)(new SCHALE.Common.FlatData.Motion()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } } public SCHALE.Common.FlatData.Motion? MoveRight { get { int o = __p.__offset(10); return o != 0 ? (SCHALE.Common.FlatData.Motion?)(new SCHALE.Common.FlatData.Motion()).__assign(__p.__indirect(o + __p.bb_pos), __p.bb) : null; } } public static Offset CreateRootMotionFlat(FlatBufferBuilder builder, VectorOffset FormsOffset = default(VectorOffset), VectorOffset ExSkillsOffset = default(VectorOffset), Offset MoveLeftOffset = default(Offset), Offset MoveRightOffset = default(Offset)) { builder.StartTable(4); RootMotionFlat.AddMoveRight(builder, MoveRightOffset); RootMotionFlat.AddMoveLeft(builder, MoveLeftOffset); RootMotionFlat.AddExSkills(builder, ExSkillsOffset); RootMotionFlat.AddForms(builder, FormsOffset); return RootMotionFlat.EndRootMotionFlat(builder); } public static void StartRootMotionFlat(FlatBufferBuilder builder) { builder.StartTable(4); } public static void AddForms(FlatBufferBuilder builder, VectorOffset formsOffset) { builder.AddOffset(0, formsOffset.Value, 0); } public static VectorOffset CreateFormsVector(FlatBufferBuilder builder, Offset[] 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 CreateFormsVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateFormsVectorBlock(FlatBufferBuilder builder, ArraySegment> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateFormsVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add>(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartFormsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddExSkills(FlatBufferBuilder builder, VectorOffset exSkillsOffset) { builder.AddOffset(1, exSkillsOffset.Value, 0); } public static VectorOffset CreateExSkillsVector(FlatBufferBuilder builder, Offset[] 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 CreateExSkillsVectorBlock(FlatBufferBuilder builder, Offset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateExSkillsVectorBlock(FlatBufferBuilder builder, ArraySegment> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateExSkillsVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add>(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartExSkillsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddMoveLeft(FlatBufferBuilder builder, Offset moveLeftOffset) { builder.AddOffset(2, moveLeftOffset.Value, 0); } public static void AddMoveRight(FlatBufferBuilder builder, Offset moveRightOffset) { builder.AddOffset(3, moveRightOffset.Value, 0); } public static Offset EndRootMotionFlat(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public RootMotionFlatT UnPack() { var _o = new RootMotionFlatT(); this.UnPackTo(_o); return _o; } public void UnPackTo(RootMotionFlatT _o) { byte[] key = { 0 }; _o.Forms = new List(); for (var _j = 0; _j < this.FormsLength; ++_j) {_o.Forms.Add(this.Forms(_j).HasValue ? this.Forms(_j).Value.UnPack() : null);} _o.ExSkills = new List(); for (var _j = 0; _j < this.ExSkillsLength; ++_j) {_o.ExSkills.Add(this.ExSkills(_j).HasValue ? this.ExSkills(_j).Value.UnPack() : null);} _o.MoveLeft = this.MoveLeft.HasValue ? this.MoveLeft.Value.UnPack() : null; _o.MoveRight = this.MoveRight.HasValue ? this.MoveRight.Value.UnPack() : null; } public static Offset Pack(FlatBufferBuilder builder, RootMotionFlatT _o) { if (_o == null) return default(Offset); var _Forms = default(VectorOffset); if (_o.Forms != null) { var __Forms = new Offset[_o.Forms.Count]; for (var _j = 0; _j < __Forms.Length; ++_j) { __Forms[_j] = SCHALE.Common.FlatData.Form.Pack(builder, _o.Forms[_j]); } _Forms = CreateFormsVector(builder, __Forms); } var _ExSkills = default(VectorOffset); if (_o.ExSkills != null) { var __ExSkills = new Offset[_o.ExSkills.Count]; for (var _j = 0; _j < __ExSkills.Length; ++_j) { __ExSkills[_j] = SCHALE.Common.FlatData.Motion.Pack(builder, _o.ExSkills[_j]); } _ExSkills = CreateExSkillsVector(builder, __ExSkills); } var _MoveLeft = _o.MoveLeft == null ? default(Offset) : SCHALE.Common.FlatData.Motion.Pack(builder, _o.MoveLeft); var _MoveRight = _o.MoveRight == null ? default(Offset) : SCHALE.Common.FlatData.Motion.Pack(builder, _o.MoveRight); return CreateRootMotionFlat( builder, _Forms, _ExSkills, _MoveLeft, _MoveRight); } } public class RootMotionFlatT { public List Forms { get; set; } public List ExSkills { get; set; } public SCHALE.Common.FlatData.MotionT MoveLeft { get; set; } public SCHALE.Common.FlatData.MotionT MoveRight { get; set; } public RootMotionFlatT() { this.Forms = null; this.ExSkills = null; this.MoveLeft = null; this.MoveRight = null; } } static public class RootMotionFlatVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyVectorOfTables(tablePos, 4 /*Forms*/, SCHALE.Common.FlatData.FormVerify.Verify, false) && verifier.VerifyVectorOfTables(tablePos, 6 /*ExSkills*/, SCHALE.Common.FlatData.MotionVerify.Verify, false) && verifier.VerifyTable(tablePos, 8 /*MoveLeft*/, SCHALE.Common.FlatData.MotionVerify.Verify, false) && verifier.VerifyTable(tablePos, 10 /*MoveRight*/, SCHALE.Common.FlatData.MotionVerify.Verify, false) && verifier.VerifyTableEnd(tablePos); } } }