// // 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 ShopFreeRecruitExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ShopFreeRecruitExcel GetRootAsShopFreeRecruitExcel(ByteBuffer _bb) { return GetRootAsShopFreeRecruitExcel(_bb, new ShopFreeRecruitExcel()); } public static ShopFreeRecruitExcel GetRootAsShopFreeRecruitExcel(ByteBuffer _bb, ShopFreeRecruitExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public ShopFreeRecruitExcel __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 string FreeRecruitPeriodFrom { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetFreeRecruitPeriodFromBytes() { return __p.__vector_as_span(6, 1); } #else public ArraySegment? GetFreeRecruitPeriodFromBytes() { return __p.__vector_as_arraysegment(6); } #endif public byte[] GetFreeRecruitPeriodFromArray() { return __p.__vector_as_array(6); } public string FreeRecruitPeriodTo { get { int o = __p.__offset(8); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetFreeRecruitPeriodToBytes() { return __p.__vector_as_span(8, 1); } #else public ArraySegment? GetFreeRecruitPeriodToBytes() { return __p.__vector_as_arraysegment(8); } #endif public byte[] GetFreeRecruitPeriodToArray() { return __p.__vector_as_array(8); } public SCHALE.Common.FlatData.ShopFreeRecruitType FreeRecruitType { get { int o = __p.__offset(10); return o != 0 ? (SCHALE.Common.FlatData.ShopFreeRecruitType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.ShopFreeRecruitType.None; } } public string FreeRecruitDecorationImagePath { get { int o = __p.__offset(12); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetFreeRecruitDecorationImagePathBytes() { return __p.__vector_as_span(12, 1); } #else public ArraySegment? GetFreeRecruitDecorationImagePathBytes() { return __p.__vector_as_arraysegment(12); } #endif public byte[] GetFreeRecruitDecorationImagePathArray() { return __p.__vector_as_array(12); } public long ShopRecruitId(int j) { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int ShopRecruitIdLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetShopRecruitIdBytes() { return __p.__vector_as_span(14, 8); } #else public ArraySegment? GetShopRecruitIdBytes() { return __p.__vector_as_arraysegment(14); } #endif public long[] GetShopRecruitIdArray() { return __p.__vector_as_array(14); } public static Offset CreateShopFreeRecruitExcel(FlatBufferBuilder builder, long Id = 0, StringOffset FreeRecruitPeriodFromOffset = default(StringOffset), StringOffset FreeRecruitPeriodToOffset = default(StringOffset), SCHALE.Common.FlatData.ShopFreeRecruitType FreeRecruitType = SCHALE.Common.FlatData.ShopFreeRecruitType.None, StringOffset FreeRecruitDecorationImagePathOffset = default(StringOffset), VectorOffset ShopRecruitIdOffset = default(VectorOffset)) { builder.StartTable(6); ShopFreeRecruitExcel.AddId(builder, Id); ShopFreeRecruitExcel.AddShopRecruitId(builder, ShopRecruitIdOffset); ShopFreeRecruitExcel.AddFreeRecruitDecorationImagePath(builder, FreeRecruitDecorationImagePathOffset); ShopFreeRecruitExcel.AddFreeRecruitType(builder, FreeRecruitType); ShopFreeRecruitExcel.AddFreeRecruitPeriodTo(builder, FreeRecruitPeriodToOffset); ShopFreeRecruitExcel.AddFreeRecruitPeriodFrom(builder, FreeRecruitPeriodFromOffset); return ShopFreeRecruitExcel.EndShopFreeRecruitExcel(builder); } public static void StartShopFreeRecruitExcel(FlatBufferBuilder builder) { builder.StartTable(6); } public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); } public static void AddFreeRecruitPeriodFrom(FlatBufferBuilder builder, StringOffset freeRecruitPeriodFromOffset) { builder.AddOffset(1, freeRecruitPeriodFromOffset.Value, 0); } public static void AddFreeRecruitPeriodTo(FlatBufferBuilder builder, StringOffset freeRecruitPeriodToOffset) { builder.AddOffset(2, freeRecruitPeriodToOffset.Value, 0); } public static void AddFreeRecruitType(FlatBufferBuilder builder, SCHALE.Common.FlatData.ShopFreeRecruitType freeRecruitType) { builder.AddInt(3, (int)freeRecruitType, 0); } public static void AddFreeRecruitDecorationImagePath(FlatBufferBuilder builder, StringOffset freeRecruitDecorationImagePathOffset) { builder.AddOffset(4, freeRecruitDecorationImagePathOffset.Value, 0); } public static void AddShopRecruitId(FlatBufferBuilder builder, VectorOffset shopRecruitIdOffset) { builder.AddOffset(5, shopRecruitIdOffset.Value, 0); } public static VectorOffset CreateShopRecruitIdVector(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 CreateShopRecruitIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateShopRecruitIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateShopRecruitIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartShopRecruitIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static Offset EndShopFreeRecruitExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public ShopFreeRecruitExcelT UnPack() { var _o = new ShopFreeRecruitExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(ShopFreeRecruitExcelT _o) { byte[] key = TableEncryptionService.CreateKey("ShopFreeRecruit"); _o.Id = TableEncryptionService.Convert(this.Id, key); _o.FreeRecruitPeriodFrom = TableEncryptionService.Convert(this.FreeRecruitPeriodFrom, key); _o.FreeRecruitPeriodTo = TableEncryptionService.Convert(this.FreeRecruitPeriodTo, key); _o.FreeRecruitType = TableEncryptionService.Convert(this.FreeRecruitType, key); _o.FreeRecruitDecorationImagePath = TableEncryptionService.Convert(this.FreeRecruitDecorationImagePath, key); _o.ShopRecruitId = new List(); for (var _j = 0; _j < this.ShopRecruitIdLength; ++_j) {_o.ShopRecruitId.Add(TableEncryptionService.Convert(this.ShopRecruitId(_j), key));} } public static Offset Pack(FlatBufferBuilder builder, ShopFreeRecruitExcelT _o) { if (_o == null) return default(Offset); var _FreeRecruitPeriodFrom = _o.FreeRecruitPeriodFrom == null ? default(StringOffset) : builder.CreateString(_o.FreeRecruitPeriodFrom); var _FreeRecruitPeriodTo = _o.FreeRecruitPeriodTo == null ? default(StringOffset) : builder.CreateString(_o.FreeRecruitPeriodTo); var _FreeRecruitDecorationImagePath = _o.FreeRecruitDecorationImagePath == null ? default(StringOffset) : builder.CreateString(_o.FreeRecruitDecorationImagePath); var _ShopRecruitId = default(VectorOffset); if (_o.ShopRecruitId != null) { var __ShopRecruitId = _o.ShopRecruitId.ToArray(); _ShopRecruitId = CreateShopRecruitIdVector(builder, __ShopRecruitId); } return CreateShopFreeRecruitExcel( builder, _o.Id, _FreeRecruitPeriodFrom, _FreeRecruitPeriodTo, _o.FreeRecruitType, _FreeRecruitDecorationImagePath, _ShopRecruitId); } } public class ShopFreeRecruitExcelT { public long Id { get; set; } public string FreeRecruitPeriodFrom { get; set; } public string FreeRecruitPeriodTo { get; set; } public SCHALE.Common.FlatData.ShopFreeRecruitType FreeRecruitType { get; set; } public string FreeRecruitDecorationImagePath { get; set; } public List ShopRecruitId { get; set; } public ShopFreeRecruitExcelT() { this.Id = 0; this.FreeRecruitPeriodFrom = null; this.FreeRecruitPeriodTo = null; this.FreeRecruitType = SCHALE.Common.FlatData.ShopFreeRecruitType.None; this.FreeRecruitDecorationImagePath = null; this.ShopRecruitId = null; } } static public class ShopFreeRecruitExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*Id*/, 8 /*long*/, 8, false) && verifier.VerifyString(tablePos, 6 /*FreeRecruitPeriodFrom*/, false) && verifier.VerifyString(tablePos, 8 /*FreeRecruitPeriodTo*/, false) && verifier.VerifyField(tablePos, 10 /*FreeRecruitType*/, 4 /*SCHALE.Common.FlatData.ShopFreeRecruitType*/, 4, false) && verifier.VerifyString(tablePos, 12 /*FreeRecruitDecorationImagePath*/, false) && verifier.VerifyVectorOfData(tablePos, 14 /*ShopRecruitId*/, 8 /*long*/, false) && verifier.VerifyTableEnd(tablePos); } } }