// // 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 ConquestUnexpectedEventExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static ConquestUnexpectedEventExcel GetRootAsConquestUnexpectedEventExcel(ByteBuffer _bb) { return GetRootAsConquestUnexpectedEventExcel(_bb, new ConquestUnexpectedEventExcel()); } public static ConquestUnexpectedEventExcel GetRootAsConquestUnexpectedEventExcel(ByteBuffer _bb, ConquestUnexpectedEventExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public ConquestUnexpectedEventExcel __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 SCHALE.Common.FlatData.ParcelType UnexpectedEventConditionType { get { int o = __p.__offset(6); return o != 0 ? (SCHALE.Common.FlatData.ParcelType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.ParcelType.None_; } } public long UnexpectedEventConditionUniqueId { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public long UnexpectedEventConditionAmount { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } } public int UnexpectedEventOccurDailyLimitCount { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public int UnitCountPerStep { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public string UnexpectedEventPrefab(int j) { int o = __p.__offset(16); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; } public int UnexpectedEventPrefabLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } } public long UnexpectedEventUnitId(int j) { int o = __p.__offset(18); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int UnexpectedEventUnitIdLength { get { int o = __p.__offset(18); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetUnexpectedEventUnitIdBytes() { return __p.__vector_as_span(18, 8); } #else public ArraySegment? GetUnexpectedEventUnitIdBytes() { return __p.__vector_as_arraysegment(18); } #endif public long[] GetUnexpectedEventUnitIdArray() { return __p.__vector_as_array(18); } public static Offset CreateConquestUnexpectedEventExcel(FlatBufferBuilder builder, long EventContentId = 0, SCHALE.Common.FlatData.ParcelType UnexpectedEventConditionType = SCHALE.Common.FlatData.ParcelType.None_, long UnexpectedEventConditionUniqueId = 0, long UnexpectedEventConditionAmount = 0, int UnexpectedEventOccurDailyLimitCount = 0, int UnitCountPerStep = 0, VectorOffset UnexpectedEventPrefabOffset = default(VectorOffset), VectorOffset UnexpectedEventUnitIdOffset = default(VectorOffset)) { builder.StartTable(8); ConquestUnexpectedEventExcel.AddUnexpectedEventConditionAmount(builder, UnexpectedEventConditionAmount); ConquestUnexpectedEventExcel.AddUnexpectedEventConditionUniqueId(builder, UnexpectedEventConditionUniqueId); ConquestUnexpectedEventExcel.AddEventContentId(builder, EventContentId); ConquestUnexpectedEventExcel.AddUnexpectedEventUnitId(builder, UnexpectedEventUnitIdOffset); ConquestUnexpectedEventExcel.AddUnexpectedEventPrefab(builder, UnexpectedEventPrefabOffset); ConquestUnexpectedEventExcel.AddUnitCountPerStep(builder, UnitCountPerStep); ConquestUnexpectedEventExcel.AddUnexpectedEventOccurDailyLimitCount(builder, UnexpectedEventOccurDailyLimitCount); ConquestUnexpectedEventExcel.AddUnexpectedEventConditionType(builder, UnexpectedEventConditionType); return ConquestUnexpectedEventExcel.EndConquestUnexpectedEventExcel(builder); } public static void StartConquestUnexpectedEventExcel(FlatBufferBuilder builder) { builder.StartTable(8); } public static void AddEventContentId(FlatBufferBuilder builder, long eventContentId) { builder.AddLong(0, eventContentId, 0); } public static void AddUnexpectedEventConditionType(FlatBufferBuilder builder, SCHALE.Common.FlatData.ParcelType unexpectedEventConditionType) { builder.AddInt(1, (int)unexpectedEventConditionType, 0); } public static void AddUnexpectedEventConditionUniqueId(FlatBufferBuilder builder, long unexpectedEventConditionUniqueId) { builder.AddLong(2, unexpectedEventConditionUniqueId, 0); } public static void AddUnexpectedEventConditionAmount(FlatBufferBuilder builder, long unexpectedEventConditionAmount) { builder.AddLong(3, unexpectedEventConditionAmount, 0); } public static void AddUnexpectedEventOccurDailyLimitCount(FlatBufferBuilder builder, int unexpectedEventOccurDailyLimitCount) { builder.AddInt(4, unexpectedEventOccurDailyLimitCount, 0); } public static void AddUnitCountPerStep(FlatBufferBuilder builder, int unitCountPerStep) { builder.AddInt(5, unitCountPerStep, 0); } public static void AddUnexpectedEventPrefab(FlatBufferBuilder builder, VectorOffset unexpectedEventPrefabOffset) { builder.AddOffset(6, unexpectedEventPrefabOffset.Value, 0); } public static VectorOffset CreateUnexpectedEventPrefabVector(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddOffset(data[i].Value); return builder.EndVector(); } public static VectorOffset CreateUnexpectedEventPrefabVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateUnexpectedEventPrefabVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateUnexpectedEventPrefabVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartUnexpectedEventPrefabVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static void AddUnexpectedEventUnitId(FlatBufferBuilder builder, VectorOffset unexpectedEventUnitIdOffset) { builder.AddOffset(7, unexpectedEventUnitIdOffset.Value, 0); } public static VectorOffset CreateUnexpectedEventUnitIdVector(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 CreateUnexpectedEventUnitIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateUnexpectedEventUnitIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateUnexpectedEventUnitIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartUnexpectedEventUnitIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static Offset EndConquestUnexpectedEventExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public ConquestUnexpectedEventExcelT UnPack() { var _o = new ConquestUnexpectedEventExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(ConquestUnexpectedEventExcelT _o) { byte[] key = TableEncryptionService.CreateKey("ConquestUnexpectedEvent"); _o.EventContentId = TableEncryptionService.Convert(this.EventContentId, key); _o.UnexpectedEventConditionType = TableEncryptionService.Convert(this.UnexpectedEventConditionType, key); _o.UnexpectedEventConditionUniqueId = TableEncryptionService.Convert(this.UnexpectedEventConditionUniqueId, key); _o.UnexpectedEventConditionAmount = TableEncryptionService.Convert(this.UnexpectedEventConditionAmount, key); _o.UnexpectedEventOccurDailyLimitCount = TableEncryptionService.Convert(this.UnexpectedEventOccurDailyLimitCount, key); _o.UnitCountPerStep = TableEncryptionService.Convert(this.UnitCountPerStep, key); _o.UnexpectedEventPrefab = new List(); for (var _j = 0; _j < this.UnexpectedEventPrefabLength; ++_j) {_o.UnexpectedEventPrefab.Add(TableEncryptionService.Convert(this.UnexpectedEventPrefab(_j), key));} _o.UnexpectedEventUnitId = new List(); for (var _j = 0; _j < this.UnexpectedEventUnitIdLength; ++_j) {_o.UnexpectedEventUnitId.Add(TableEncryptionService.Convert(this.UnexpectedEventUnitId(_j), key));} } public static Offset Pack(FlatBufferBuilder builder, ConquestUnexpectedEventExcelT _o) { if (_o == null) return default(Offset); var _UnexpectedEventPrefab = default(VectorOffset); if (_o.UnexpectedEventPrefab != null) { var __UnexpectedEventPrefab = new StringOffset[_o.UnexpectedEventPrefab.Count]; for (var _j = 0; _j < __UnexpectedEventPrefab.Length; ++_j) { __UnexpectedEventPrefab[_j] = builder.CreateString(_o.UnexpectedEventPrefab[_j]); } _UnexpectedEventPrefab = CreateUnexpectedEventPrefabVector(builder, __UnexpectedEventPrefab); } var _UnexpectedEventUnitId = default(VectorOffset); if (_o.UnexpectedEventUnitId != null) { var __UnexpectedEventUnitId = _o.UnexpectedEventUnitId.ToArray(); _UnexpectedEventUnitId = CreateUnexpectedEventUnitIdVector(builder, __UnexpectedEventUnitId); } return CreateConquestUnexpectedEventExcel( builder, _o.EventContentId, _o.UnexpectedEventConditionType, _o.UnexpectedEventConditionUniqueId, _o.UnexpectedEventConditionAmount, _o.UnexpectedEventOccurDailyLimitCount, _o.UnitCountPerStep, _UnexpectedEventPrefab, _UnexpectedEventUnitId); } } public class ConquestUnexpectedEventExcelT { public long EventContentId { get; set; } public SCHALE.Common.FlatData.ParcelType UnexpectedEventConditionType { get; set; } public long UnexpectedEventConditionUniqueId { get; set; } public long UnexpectedEventConditionAmount { get; set; } public int UnexpectedEventOccurDailyLimitCount { get; set; } public int UnitCountPerStep { get; set; } public List UnexpectedEventPrefab { get; set; } public List UnexpectedEventUnitId { get; set; } public ConquestUnexpectedEventExcelT() { this.EventContentId = 0; this.UnexpectedEventConditionType = SCHALE.Common.FlatData.ParcelType.None_; this.UnexpectedEventConditionUniqueId = 0; this.UnexpectedEventConditionAmount = 0; this.UnexpectedEventOccurDailyLimitCount = 0; this.UnitCountPerStep = 0; this.UnexpectedEventPrefab = null; this.UnexpectedEventUnitId = null; } } static public class ConquestUnexpectedEventExcelVerify { 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 /*UnexpectedEventConditionType*/, 4 /*SCHALE.Common.FlatData.ParcelType*/, 4, false) && verifier.VerifyField(tablePos, 8 /*UnexpectedEventConditionUniqueId*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 10 /*UnexpectedEventConditionAmount*/, 8 /*long*/, 8, false) && verifier.VerifyField(tablePos, 12 /*UnexpectedEventOccurDailyLimitCount*/, 4 /*int*/, 4, false) && verifier.VerifyField(tablePos, 14 /*UnitCountPerStep*/, 4 /*int*/, 4, false) && verifier.VerifyVectorOfStrings(tablePos, 16 /*UnexpectedEventPrefab*/, false) && verifier.VerifyVectorOfData(tablePos, 18 /*UnexpectedEventUnitId*/, 8 /*long*/, false) && verifier.VerifyTableEnd(tablePos); } } }