// // 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 ShopExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ShopExcel GetRootAsShopExcel(ByteBuffer _bb) { return GetRootAsShopExcel(_bb, new ShopExcel()); } public static ShopExcel GetRootAsShopExcel(ByteBuffer _bb, ShopExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public ShopExcel __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 uint LocalizeEtcId { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } } public SCHALE.Common.FlatData.ShopCategoryType CategoryType { get { int o = __p.__offset(8); return o != 0 ? (SCHALE.Common.FlatData.ShopCategoryType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.ShopCategoryType.General; } } public bool IsLegacy { get { int o = __p.__offset(10); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } } public long GoodsId(int j) { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int GoodsIdLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetGoodsIdBytes() { return __p.__vector_as_span(12, 8); } #else public ArraySegment? GetGoodsIdBytes() { return __p.__vector_as_arraysegment(12); } #endif public long[] GetGoodsIdArray() { return __p.__vector_as_array(12); } public long DisplayOrder { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public string SalePeriodFrom { get { int o = __p.__offset(16); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetSalePeriodFromBytes() { return __p.__vector_as_span(16, 1); } #else public ArraySegment? GetSalePeriodFromBytes() { return __p.__vector_as_arraysegment(16); } #endif public byte[] GetSalePeriodFromArray() { return __p.__vector_as_array(16); } public string SalePeriodTo { get { int o = __p.__offset(18); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetSalePeriodToBytes() { return __p.__vector_as_span(18, 1); } #else public ArraySegment? GetSalePeriodToBytes() { return __p.__vector_as_arraysegment(18); } #endif public byte[] GetSalePeriodToArray() { return __p.__vector_as_array(18); } public long PurchaseCooltimeMin { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long PurchaseCountLimit { get { int o = __p.__offset(22); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public SCHALE.Common.FlatData.PurchaseCountResetType PurchaseCountResetType { get { int o = __p.__offset(24); return o != 0 ? (SCHALE.Common.FlatData.PurchaseCountResetType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.PurchaseCountResetType.None; } } public string BuyReportEventName { get { int o = __p.__offset(26); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } } #if ENABLE_SPAN_T public Span GetBuyReportEventNameBytes() { return __p.__vector_as_span(26, 1); } #else public ArraySegment? GetBuyReportEventNameBytes() { return __p.__vector_as_arraysegment(26); } #endif public byte[] GetBuyReportEventNameArray() { return __p.__vector_as_array(26); } public bool RestrictBuyWhenInventoryFull { get { int o = __p.__offset(28); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } } public SCHALE.Common.FlatData.ProductDisplayTag DisplayTag { get { int o = __p.__offset(30); return o != 0 ? (SCHALE.Common.FlatData.ProductDisplayTag)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.ProductDisplayTag.None; } } public int ShopUpdateGroupId { get { int o = __p.__offset(32); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public static Offset CreateShopExcel(FlatBufferBuilder builder, long Id = 0, uint LocalizeEtcId = 0, SCHALE.Common.FlatData.ShopCategoryType CategoryType = SCHALE.Common.FlatData.ShopCategoryType.General, bool IsLegacy = false, VectorOffset GoodsIdOffset = default(VectorOffset), long DisplayOrder = 0, StringOffset SalePeriodFromOffset = default(StringOffset), StringOffset SalePeriodToOffset = default(StringOffset), long PurchaseCooltimeMin = 0, long PurchaseCountLimit = 0, SCHALE.Common.FlatData.PurchaseCountResetType PurchaseCountResetType = SCHALE.Common.FlatData.PurchaseCountResetType.None, StringOffset BuyReportEventNameOffset = default(StringOffset), bool RestrictBuyWhenInventoryFull = false, SCHALE.Common.FlatData.ProductDisplayTag DisplayTag = SCHALE.Common.FlatData.ProductDisplayTag.None, int ShopUpdateGroupId = 0) { builder.StartTable(15); ShopExcel.AddPurchaseCountLimit(builder, PurchaseCountLimit); ShopExcel.AddPurchaseCooltimeMin(builder, PurchaseCooltimeMin); ShopExcel.AddDisplayOrder(builder, DisplayOrder); ShopExcel.AddId(builder, Id); ShopExcel.AddShopUpdateGroupId(builder, ShopUpdateGroupId); ShopExcel.AddDisplayTag(builder, DisplayTag); ShopExcel.AddBuyReportEventName(builder, BuyReportEventNameOffset); ShopExcel.AddPurchaseCountResetType(builder, PurchaseCountResetType); ShopExcel.AddSalePeriodTo(builder, SalePeriodToOffset); ShopExcel.AddSalePeriodFrom(builder, SalePeriodFromOffset); ShopExcel.AddGoodsId(builder, GoodsIdOffset); ShopExcel.AddCategoryType(builder, CategoryType); ShopExcel.AddLocalizeEtcId(builder, LocalizeEtcId); ShopExcel.AddRestrictBuyWhenInventoryFull(builder, RestrictBuyWhenInventoryFull); ShopExcel.AddIsLegacy(builder, IsLegacy); return ShopExcel.EndShopExcel(builder); } public static void StartShopExcel(FlatBufferBuilder builder) { builder.StartTable(15); } public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); } public static void AddLocalizeEtcId(FlatBufferBuilder builder, uint localizeEtcId) { builder.AddUint(1, localizeEtcId, 0); } public static void AddCategoryType(FlatBufferBuilder builder, SCHALE.Common.FlatData.ShopCategoryType categoryType) { builder.AddInt(2, (int)categoryType, 0); } public static void AddIsLegacy(FlatBufferBuilder builder, bool isLegacy) { builder.AddBool(3, isLegacy, false); } public static void AddGoodsId(FlatBufferBuilder builder, VectorOffset goodsIdOffset) { builder.AddOffset(4, goodsIdOffset.Value, 0); } public static VectorOffset CreateGoodsIdVector(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 CreateGoodsIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateGoodsIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateGoodsIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartGoodsIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddDisplayOrder(FlatBufferBuilder builder, long displayOrder) { builder.AddLong(5, displayOrder, 0); } public static void AddSalePeriodFrom(FlatBufferBuilder builder, StringOffset salePeriodFromOffset) { builder.AddOffset(6, salePeriodFromOffset.Value, 0); } public static void AddSalePeriodTo(FlatBufferBuilder builder, StringOffset salePeriodToOffset) { builder.AddOffset(7, salePeriodToOffset.Value, 0); } public static void AddPurchaseCooltimeMin(FlatBufferBuilder builder, long purchaseCooltimeMin) { builder.AddLong(8, purchaseCooltimeMin, 0); } public static void AddPurchaseCountLimit(FlatBufferBuilder builder, long purchaseCountLimit) { builder.AddLong(9, purchaseCountLimit, 0); } public static void AddPurchaseCountResetType(FlatBufferBuilder builder, SCHALE.Common.FlatData.PurchaseCountResetType purchaseCountResetType) { builder.AddInt(10, (int)purchaseCountResetType, 0); } public static void AddBuyReportEventName(FlatBufferBuilder builder, StringOffset buyReportEventNameOffset) { builder.AddOffset(11, buyReportEventNameOffset.Value, 0); } public static void AddRestrictBuyWhenInventoryFull(FlatBufferBuilder builder, bool restrictBuyWhenInventoryFull) { builder.AddBool(12, restrictBuyWhenInventoryFull, false); } public static void AddDisplayTag(FlatBufferBuilder builder, SCHALE.Common.FlatData.ProductDisplayTag displayTag) { builder.AddInt(13, (int)displayTag, 0); } public static void AddShopUpdateGroupId(FlatBufferBuilder builder, int shopUpdateGroupId) { builder.AddInt(14, shopUpdateGroupId, 0); } public static Offset EndShopExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public ShopExcelT UnPack() { var _o = new ShopExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(ShopExcelT _o) { byte[] key = TableEncryptionService.CreateKey("Shop"); _o.Id = TableEncryptionService.Convert(this.Id, key); _o.LocalizeEtcId = TableEncryptionService.Convert(this.LocalizeEtcId, key); _o.CategoryType = TableEncryptionService.Convert(this.CategoryType, key); _o.IsLegacy = TableEncryptionService.Convert(this.IsLegacy, key); _o.GoodsId = new List(); for (var _j = 0; _j < this.GoodsIdLength; ++_j) {_o.GoodsId.Add(TableEncryptionService.Convert(this.GoodsId(_j), key));} _o.DisplayOrder = TableEncryptionService.Convert(this.DisplayOrder, key); _o.SalePeriodFrom = TableEncryptionService.Convert(this.SalePeriodFrom, key); _o.SalePeriodTo = TableEncryptionService.Convert(this.SalePeriodTo, key); _o.PurchaseCooltimeMin = TableEncryptionService.Convert(this.PurchaseCooltimeMin, key); _o.PurchaseCountLimit = TableEncryptionService.Convert(this.PurchaseCountLimit, key); _o.PurchaseCountResetType = TableEncryptionService.Convert(this.PurchaseCountResetType, key); _o.BuyReportEventName = TableEncryptionService.Convert(this.BuyReportEventName, key); _o.RestrictBuyWhenInventoryFull = TableEncryptionService.Convert(this.RestrictBuyWhenInventoryFull, key); _o.DisplayTag = TableEncryptionService.Convert(this.DisplayTag, key); _o.ShopUpdateGroupId = TableEncryptionService.Convert(this.ShopUpdateGroupId, key); } public static Offset Pack(FlatBufferBuilder builder, ShopExcelT _o) { if (_o == null) return default(Offset); var _GoodsId = default(VectorOffset); if (_o.GoodsId != null) { var __GoodsId = _o.GoodsId.ToArray(); _GoodsId = CreateGoodsIdVector(builder, __GoodsId); } var _SalePeriodFrom = _o.SalePeriodFrom == null ? default(StringOffset) : builder.CreateString(_o.SalePeriodFrom); var _SalePeriodTo = _o.SalePeriodTo == null ? default(StringOffset) : builder.CreateString(_o.SalePeriodTo); var _BuyReportEventName = _o.BuyReportEventName == null ? default(StringOffset) : builder.CreateString(_o.BuyReportEventName); return CreateShopExcel( builder, _o.Id, _o.LocalizeEtcId, _o.CategoryType, _o.IsLegacy, _GoodsId, _o.DisplayOrder, _SalePeriodFrom, _SalePeriodTo, _o.PurchaseCooltimeMin, _o.PurchaseCountLimit, _o.PurchaseCountResetType, _BuyReportEventName, _o.RestrictBuyWhenInventoryFull, _o.DisplayTag, _o.ShopUpdateGroupId); } } public class ShopExcelT { public long Id { get; set; } public uint LocalizeEtcId { get; set; } public SCHALE.Common.FlatData.ShopCategoryType CategoryType { get; set; } public bool IsLegacy { get; set; } public List GoodsId { get; set; } public long DisplayOrder { get; set; } public string SalePeriodFrom { get; set; } public string SalePeriodTo { get; set; } public long PurchaseCooltimeMin { get; set; } public long PurchaseCountLimit { get; set; } public SCHALE.Common.FlatData.PurchaseCountResetType PurchaseCountResetType { get; set; } public string BuyReportEventName { get; set; } public bool RestrictBuyWhenInventoryFull { get; set; } public SCHALE.Common.FlatData.ProductDisplayTag DisplayTag { get; set; } public int ShopUpdateGroupId { get; set; } public ShopExcelT() { this.Id = 0; this.LocalizeEtcId = 0; this.CategoryType = SCHALE.Common.FlatData.ShopCategoryType.General; this.IsLegacy = false; this.GoodsId = null; this.DisplayOrder = 0; this.SalePeriodFrom = null; this.SalePeriodTo = null; this.PurchaseCooltimeMin = 0; this.PurchaseCountLimit = 0; this.PurchaseCountResetType = SCHALE.Common.FlatData.PurchaseCountResetType.None; this.BuyReportEventName = null; this.RestrictBuyWhenInventoryFull = false; this.DisplayTag = SCHALE.Common.FlatData.ProductDisplayTag.None; this.ShopUpdateGroupId = 0; } } static public class ShopExcelVerify { 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 /*LocalizeEtcId*/, 4 /*uint*/, 4, false) && verifier.VerifyField(tablePos, 8 /*CategoryType*/, 4 /*SCHALE.Common.FlatData.ShopCategoryType*/, 4, false) && verifier.VerifyField(tablePos, 10 /*IsLegacy*/, 1 /*bool*/, 1, false) && verifier.VerifyVectorOfData(tablePos, 12 /*GoodsId*/, 8 /*long*/, false) && verifier.VerifyField(tablePos, 14 /*DisplayOrder*/, 8 /*long*/, 8, false) && verifier.VerifyString(tablePos, 16 /*SalePeriodFrom*/, false) && verifier.VerifyString(tablePos, 18 /*SalePeriodTo*/, false) && verifier.VerifyField(tablePos, 20 /*PurchaseCooltimeMin*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 22 /*PurchaseCountLimit*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 24 /*PurchaseCountResetType*/, 4 /*SCHALE.Common.FlatData.PurchaseCountResetType*/, 4, false) && verifier.VerifyString(tablePos, 26 /*BuyReportEventName*/, false) && verifier.VerifyField(tablePos, 28 /*RestrictBuyWhenInventoryFull*/, 1 /*bool*/, 1, false) && verifier.VerifyField(tablePos, 30 /*DisplayTag*/, 4 /*SCHALE.Common.FlatData.ProductDisplayTag*/, 4, false) && verifier.VerifyField(tablePos, 32 /*ShopUpdateGroupId*/, 4 /*int*/, 4, false) && verifier.VerifyTableEnd(tablePos); } } }