// // 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 TrophyCollectionExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static TrophyCollectionExcel GetRootAsTrophyCollectionExcel(ByteBuffer _bb) { return GetRootAsTrophyCollectionExcel(_bb, new TrophyCollectionExcel()); } public static TrophyCollectionExcel GetRootAsTrophyCollectionExcel(ByteBuffer _bb, TrophyCollectionExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public TrophyCollectionExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public long GroupId { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public uint LocalizeCodeId { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } public long FurnitureId(int j) { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int FurnitureIdLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetFurnitureIdBytes() { return __p.__vector_as_span(8, 8); } #else public ArraySegment? GetFurnitureIdBytes() { return __p.__vector_as_arraysegment(8); } #endif public long[] GetFurnitureIdArray() { return __p.__vector_as_array(8); } public static Offset CreateTrophyCollectionExcel(FlatBufferBuilder builder, long GroupId = 0, uint LocalizeCodeId = 0, VectorOffset FurnitureIdOffset = default(VectorOffset)) { builder.StartTable(3); TrophyCollectionExcel.AddGroupId(builder, GroupId); TrophyCollectionExcel.AddFurnitureId(builder, FurnitureIdOffset); TrophyCollectionExcel.AddLocalizeCodeId(builder, LocalizeCodeId); return TrophyCollectionExcel.EndTrophyCollectionExcel(builder); } public static void StartTrophyCollectionExcel(FlatBufferBuilder builder) { builder.StartTable(3); } public static void AddGroupId(FlatBufferBuilder builder, long groupId) { builder.AddLong(0, groupId, 0); } public static void AddLocalizeCodeId(FlatBufferBuilder builder, uint localizeCodeId) { builder.AddUint(1, localizeCodeId, 0); } public static void AddFurnitureId(FlatBufferBuilder builder, VectorOffset furnitureIdOffset) { builder.AddOffset(2, furnitureIdOffset.Value, 0); } public static VectorOffset CreateFurnitureIdVector(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 CreateFurnitureIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateFurnitureIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateFurnitureIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartFurnitureIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static Offset EndTrophyCollectionExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public TrophyCollectionExcelT UnPack() { var _o = new TrophyCollectionExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(TrophyCollectionExcelT _o) { byte[] key = TableEncryptionService.CreateKey("TrophyCollection"); _o.GroupId = TableEncryptionService.Convert(this.GroupId, key); _o.LocalizeCodeId = TableEncryptionService.Convert(this.LocalizeCodeId, key); _o.FurnitureId = new List(); for (var _j = 0; _j < this.FurnitureIdLength; ++_j) {_o.FurnitureId.Add(TableEncryptionService.Convert(this.FurnitureId(_j), key));} } public static Offset Pack(FlatBufferBuilder builder, TrophyCollectionExcelT _o) { if (_o == null) return default(Offset); var _FurnitureId = default(VectorOffset); if (_o.FurnitureId != null) { var __FurnitureId = _o.FurnitureId.ToArray(); _FurnitureId = CreateFurnitureIdVector(builder, __FurnitureId); } return CreateTrophyCollectionExcel( builder, _o.GroupId, _o.LocalizeCodeId, _FurnitureId); } } public class TrophyCollectionExcelT { public long GroupId { get; set; } public uint LocalizeCodeId { get; set; } public List FurnitureId { get; set; } public TrophyCollectionExcelT() { this.GroupId = 0; this.LocalizeCodeId = 0; this.FurnitureId = null; } } static public class TrophyCollectionExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*GroupId*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 6 /*LocalizeCodeId*/, 4 /*uint*/, 4, false) && verifier.VerifyVectorOfData(tablePos, 8 /*FurnitureId*/, 8 /*long*/, false) && verifier.VerifyTableEnd(tablePos); } } }