// // automatically generated by the FlatBuffers compiler, do not modify // namespace SCHALE.Common.FlatData { using global::System; using global::System.Collections.Generic; using global::Google.FlatBuffers; public struct AcademyZoneExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static AcademyZoneExcel GetRootAsAcademyZoneExcel(ByteBuffer _bb) { return GetRootAsAcademyZoneExcel(_bb, new AcademyZoneExcel()); } public static AcademyZoneExcel GetRootAsAcademyZoneExcel(ByteBuffer _bb, AcademyZoneExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public AcademyZoneExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public long Id { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long LocationId { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long LocationRankForUnlock { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public uint LocalizeEtcId { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } public long StudentVisitProb(int j) { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int StudentVisitProbLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetStudentVisitProbBytes() { return __p.__vector_as_span(12, 8); } #else public ArraySegment? GetStudentVisitProbBytes() { return __p.__vector_as_arraysegment(12); } #endif public long[] GetStudentVisitProbArray() { return __p.__vector_as_array(12); } public long RewardGroupId { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public SCHALE.Common.FlatData.Tag Tags(int j) { int o = __p.__offset(16); return o != 0 ? (SCHALE.Common.FlatData.Tag)__p.bb.GetInt(__p.__vector(o) + j * 4) : (SCHALE.Common.FlatData.Tag)0; } public int TagsLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetTagsBytes() { return __p.__vector_as_span(16, 4); } #else public ArraySegment? GetTagsBytes() { return __p.__vector_as_arraysegment(16); } #endif public SCHALE.Common.FlatData.Tag[] GetTagsArray() { int o = __p.__offset(16); if (o == 0) return null; int p = __p.__vector(o); int l = __p.__vector_len(o); SCHALE.Common.FlatData.Tag[] a = new SCHALE.Common.FlatData.Tag[l]; for (int i = 0; i < l; i++) { a[i] = (SCHALE.Common.FlatData.Tag)__p.bb.GetInt(p + i * 4); } return a; } public static Offset CreateAcademyZoneExcel(FlatBufferBuilder builder, long Id = 0, long LocationId = 0, long LocationRankForUnlock = 0, uint LocalizeEtcId = 0, VectorOffset StudentVisitProbOffset = default(VectorOffset), long RewardGroupId = 0, VectorOffset TagsOffset = default(VectorOffset)) { builder.StartTable(7); AcademyZoneExcel.AddRewardGroupId(builder, RewardGroupId); AcademyZoneExcel.AddLocationRankForUnlock(builder, LocationRankForUnlock); AcademyZoneExcel.AddLocationId(builder, LocationId); AcademyZoneExcel.AddId(builder, Id); AcademyZoneExcel.AddTags(builder, TagsOffset); AcademyZoneExcel.AddStudentVisitProb(builder, StudentVisitProbOffset); AcademyZoneExcel.AddLocalizeEtcId(builder, LocalizeEtcId); return AcademyZoneExcel.EndAcademyZoneExcel(builder); } public static void StartAcademyZoneExcel(FlatBufferBuilder builder) { builder.StartTable(7); } public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); } public static void AddLocationId(FlatBufferBuilder builder, long locationId) { builder.AddLong(1, locationId, 0); } public static void AddLocationRankForUnlock(FlatBufferBuilder builder, long locationRankForUnlock) { builder.AddLong(2, locationRankForUnlock, 0); } public static void AddLocalizeEtcId(FlatBufferBuilder builder, uint localizeEtcId) { builder.AddUint(3, localizeEtcId, 0); } public static void AddStudentVisitProb(FlatBufferBuilder builder, VectorOffset studentVisitProbOffset) { builder.AddOffset(4, studentVisitProbOffset.Value, 0); } public static VectorOffset CreateStudentVisitProbVector(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); for (int i = data.Length - 1; i >= 0; i--) builder.AddLong(data[i]); return builder.EndVector(); } public static VectorOffset CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartStudentVisitProbVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddRewardGroupId(FlatBufferBuilder builder, long rewardGroupId) { builder.AddLong(5, rewardGroupId, 0); } public static void AddTags(FlatBufferBuilder builder, VectorOffset tagsOffset) { builder.AddOffset(6, tagsOffset.Value, 0); } public static VectorOffset CreateTagsVector(FlatBufferBuilder builder, SCHALE.Common.FlatData.Tag[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt((int)data[i]); return builder.EndVector(); } public static VectorOffset CreateTagsVectorBlock(FlatBufferBuilder builder, SCHALE.Common.FlatData.Tag[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateTagsVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateTagsVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartTagsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static Offset EndAcademyZoneExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } } static public class AcademyZoneExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*Id*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 6 /*LocationId*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 8 /*LocationRankForUnlock*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 10 /*LocalizeEtcId*/, 4 /*uint*/, 4, false) && verifier.VerifyVectorOfData(tablePos, 12 /*StudentVisitProb*/, 8 /*long*/, false) && verifier.VerifyField(tablePos, 14 /*RewardGroupId*/, 8 /*long*/, 8, false) && verifier.VerifyVectorOfData(tablePos, 16 /*Tags*/, 4 /*SCHALE.Common.FlatData.Tag*/, false) && verifier.VerifyTableEnd(tablePos); } } }