// // 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 EventContentTreasureRoundExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static EventContentTreasureRoundExcel GetRootAsEventContentTreasureRoundExcel(ByteBuffer _bb) { return GetRootAsEventContentTreasureRoundExcel(_bb, new EventContentTreasureRoundExcel()); } public static EventContentTreasureRoundExcel GetRootAsEventContentTreasureRoundExcel(ByteBuffer _bb, EventContentTreasureRoundExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public EventContentTreasureRoundExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public long EventContentId { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public int TreasureRound { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public int TreasureRoundSize(int j) { int o = __p.__offset(8); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; } public int TreasureRoundSizeLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetTreasureRoundSizeBytes() { return __p.__vector_as_span(8, 4); } #else public ArraySegment? GetTreasureRoundSizeBytes() { return __p.__vector_as_arraysegment(8); } #endif public int[] GetTreasureRoundSizeArray() { return __p.__vector_as_array(8); } public bool CellVisualSortUnstructed { get { int o = __p.__offset(10); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } } public long CellCheckGoodsId { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long CellRewardId { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long RewardID(int j) { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int RewardIDLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetRewardIDBytes() { return __p.__vector_as_span(16, 8); } #else public ArraySegment? GetRewardIDBytes() { return __p.__vector_as_arraysegment(16); } #endif public long[] GetRewardIDArray() { return __p.__vector_as_array(16); } public int RewardAmount(int j) { int o = __p.__offset(18); return o != 0 ? __p.bb.GetInt(__p.__vector(o) + j * 4) : (int)0; } public int RewardAmountLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetRewardAmountBytes() { return __p.__vector_as_span(18, 4); } #else public ArraySegment? GetRewardAmountBytes() { return __p.__vector_as_arraysegment(18); } #endif public int[] GetRewardAmountArray() { return __p.__vector_as_array(18); } public string TreasureCellImagePath { get { int o = __p.__offset(20); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetTreasureCellImagePathBytes() { return __p.__vector_as_span(20, 1); } #else public ArraySegment? GetTreasureCellImagePathBytes() { return __p.__vector_as_arraysegment(20); } #endif public byte[] GetTreasureCellImagePathArray() { return __p.__vector_as_array(20); } public static Offset CreateEventContentTreasureRoundExcel(FlatBufferBuilder builder, long EventContentId = 0, int TreasureRound = 0, VectorOffset TreasureRoundSizeOffset = default(VectorOffset), bool CellVisualSortUnstructed = false, long CellCheckGoodsId = 0, long CellRewardId = 0, VectorOffset RewardIDOffset = default(VectorOffset), VectorOffset RewardAmountOffset = default(VectorOffset), StringOffset TreasureCellImagePathOffset = default(StringOffset)) { builder.StartTable(9); EventContentTreasureRoundExcel.AddCellRewardId(builder, CellRewardId); EventContentTreasureRoundExcel.AddCellCheckGoodsId(builder, CellCheckGoodsId); EventContentTreasureRoundExcel.AddEventContentId(builder, EventContentId); EventContentTreasureRoundExcel.AddTreasureCellImagePath(builder, TreasureCellImagePathOffset); EventContentTreasureRoundExcel.AddRewardAmount(builder, RewardAmountOffset); EventContentTreasureRoundExcel.AddRewardID(builder, RewardIDOffset); EventContentTreasureRoundExcel.AddTreasureRoundSize(builder, TreasureRoundSizeOffset); EventContentTreasureRoundExcel.AddTreasureRound(builder, TreasureRound); EventContentTreasureRoundExcel.AddCellVisualSortUnstructed(builder, CellVisualSortUnstructed); return EventContentTreasureRoundExcel.EndEventContentTreasureRoundExcel(builder); } public static void StartEventContentTreasureRoundExcel(FlatBufferBuilder builder) { builder.StartTable(9); } public static void AddEventContentId(FlatBufferBuilder builder, long eventContentId) { builder.AddLong(0, eventContentId, 0); } public static void AddTreasureRound(FlatBufferBuilder builder, int treasureRound) { builder.AddInt(1, treasureRound, 0); } public static void AddTreasureRoundSize(FlatBufferBuilder builder, VectorOffset treasureRoundSizeOffset) { builder.AddOffset(2, treasureRoundSizeOffset.Value, 0); } public static VectorOffset CreateTreasureRoundSizeVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); } public static VectorOffset CreateTreasureRoundSizeVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateTreasureRoundSizeVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateTreasureRoundSizeVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartTreasureRoundSizeVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddCellVisualSortUnstructed(FlatBufferBuilder builder, bool cellVisualSortUnstructed) { builder.AddBool(3, cellVisualSortUnstructed, false); } public static void AddCellCheckGoodsId(FlatBufferBuilder builder, long cellCheckGoodsId) { builder.AddLong(4, cellCheckGoodsId, 0); } public static void AddCellRewardId(FlatBufferBuilder builder, long cellRewardId) { builder.AddLong(5, cellRewardId, 0); } public static void AddRewardID(FlatBufferBuilder builder, VectorOffset rewardIDOffset) { builder.AddOffset(6, rewardIDOffset.Value, 0); } public static VectorOffset CreateRewardIDVector(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 CreateRewardIDVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateRewardIDVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateRewardIDVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartRewardIDVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddRewardAmount(FlatBufferBuilder builder, VectorOffset rewardAmountOffset) { builder.AddOffset(7, rewardAmountOffset.Value, 0); } public static VectorOffset CreateRewardAmountVector(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt(data[i]); return builder.EndVector(); } public static VectorOffset CreateRewardAmountVectorBlock(FlatBufferBuilder builder, int[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateRewardAmountVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateRewardAmountVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartRewardAmountVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddTreasureCellImagePath(FlatBufferBuilder builder, StringOffset treasureCellImagePathOffset) { builder.AddOffset(8, treasureCellImagePathOffset.Value, 0); } public static Offset EndEventContentTreasureRoundExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public EventContentTreasureRoundExcelT UnPack() { var _o = new EventContentTreasureRoundExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(EventContentTreasureRoundExcelT _o) { byte[] key = TableEncryptionService.CreateKey("EventContentTreasureRound"); _o.EventContentId = TableEncryptionService.Convert(this.EventContentId, key); _o.TreasureRound = TableEncryptionService.Convert(this.TreasureRound, key); _o.TreasureRoundSize = new List(); for (var _j = 0; _j < this.TreasureRoundSizeLength; ++_j) {_o.TreasureRoundSize.Add(TableEncryptionService.Convert(this.TreasureRoundSize(_j), key));} _o.CellVisualSortUnstructed = TableEncryptionService.Convert(this.CellVisualSortUnstructed, key); _o.CellCheckGoodsId = TableEncryptionService.Convert(this.CellCheckGoodsId, key); _o.CellRewardId = TableEncryptionService.Convert(this.CellRewardId, key); _o.RewardID = new List(); for (var _j = 0; _j < this.RewardIDLength; ++_j) {_o.RewardID.Add(TableEncryptionService.Convert(this.RewardID(_j), key));} _o.RewardAmount = new List(); for (var _j = 0; _j < this.RewardAmountLength; ++_j) {_o.RewardAmount.Add(TableEncryptionService.Convert(this.RewardAmount(_j), key));} _o.TreasureCellImagePath = TableEncryptionService.Convert(this.TreasureCellImagePath, key); } public static Offset Pack(FlatBufferBuilder builder, EventContentTreasureRoundExcelT _o) { if (_o == null) return default(Offset); var _TreasureRoundSize = default(VectorOffset); if (_o.TreasureRoundSize != null) { var __TreasureRoundSize = _o.TreasureRoundSize.ToArray(); _TreasureRoundSize = CreateTreasureRoundSizeVector(builder, __TreasureRoundSize); } var _RewardID = default(VectorOffset); if (_o.RewardID != null) { var __RewardID = _o.RewardID.ToArray(); _RewardID = CreateRewardIDVector(builder, __RewardID); } var _RewardAmount = default(VectorOffset); if (_o.RewardAmount != null) { var __RewardAmount = _o.RewardAmount.ToArray(); _RewardAmount = CreateRewardAmountVector(builder, __RewardAmount); } var _TreasureCellImagePath = _o.TreasureCellImagePath == null ? default(StringOffset) : builder.CreateString(_o.TreasureCellImagePath); return CreateEventContentTreasureRoundExcel( builder, _o.EventContentId, _o.TreasureRound, _TreasureRoundSize, _o.CellVisualSortUnstructed, _o.CellCheckGoodsId, _o.CellRewardId, _RewardID, _RewardAmount, _TreasureCellImagePath); } } public class EventContentTreasureRoundExcelT { public long EventContentId { get; set; } public int TreasureRound { get; set; } public List TreasureRoundSize { get; set; } public bool CellVisualSortUnstructed { get; set; } public long CellCheckGoodsId { get; set; } public long CellRewardId { get; set; } public List RewardID { get; set; } public List RewardAmount { get; set; } public string TreasureCellImagePath { get; set; } public EventContentTreasureRoundExcelT() { this.EventContentId = 0; this.TreasureRound = 0; this.TreasureRoundSize = null; this.CellVisualSortUnstructed = false; this.CellCheckGoodsId = 0; this.CellRewardId = 0; this.RewardID = null; this.RewardAmount = null; this.TreasureCellImagePath = null; } } static public class EventContentTreasureRoundExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*EventContentId*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 6 /*TreasureRound*/, 4 /*int*/, 4, false) && verifier.VerifyVectorOfData(tablePos, 8 /*TreasureRoundSize*/, 4 /*int*/, false) && verifier.VerifyField(tablePos, 10 /*CellVisualSortUnstructed*/, 1 /*bool*/, 1, false) && verifier.VerifyField(tablePos, 12 /*CellCheckGoodsId*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 14 /*CellRewardId*/, 8 /*long*/, 8, false) && verifier.VerifyVectorOfData(tablePos, 16 /*RewardID*/, 8 /*long*/, false) && verifier.VerifyVectorOfData(tablePos, 18 /*RewardAmount*/, 4 /*int*/, false) && verifier.VerifyString(tablePos, 20 /*TreasureCellImagePath*/, false) && verifier.VerifyTableEnd(tablePos); } } }