// // 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 WeekDungeonOpenScheduleExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static WeekDungeonOpenScheduleExcel GetRootAsWeekDungeonOpenScheduleExcel(ByteBuffer _bb) { return GetRootAsWeekDungeonOpenScheduleExcel(_bb, new WeekDungeonOpenScheduleExcel()); } public static WeekDungeonOpenScheduleExcel GetRootAsWeekDungeonOpenScheduleExcel(ByteBuffer _bb, WeekDungeonOpenScheduleExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public WeekDungeonOpenScheduleExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public SCHALE.Common.FlatData.WeekDay WeekDay_ { get { int o = __p.__offset(4); return o != 0 ? (SCHALE.Common.FlatData.WeekDay)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.WeekDay.Sunday; } } public SCHALE.Common.FlatData.WeekDungeonType Open(int j) { int o = __p.__offset(6); return o != 0 ? (SCHALE.Common.FlatData.WeekDungeonType)__p.bb.GetInt(__p.__vector(o) + j * 4) : (SCHALE.Common.FlatData.WeekDungeonType)0; } public int OpenLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetOpenBytes() { return __p.__vector_as_span(6, 4); } #else public ArraySegment? GetOpenBytes() { return __p.__vector_as_arraysegment(6); } #endif public SCHALE.Common.FlatData.WeekDungeonType[] GetOpenArray() { int o = __p.__offset(6); if (o == 0) return null; int p = __p.__vector(o); int l = __p.__vector_len(o); SCHALE.Common.FlatData.WeekDungeonType[] a = new SCHALE.Common.FlatData.WeekDungeonType[l]; for (int i = 0; i < l; i++) { a[i] = (SCHALE.Common.FlatData.WeekDungeonType)__p.bb.GetInt(p + i * 4); } return a; } public static Offset CreateWeekDungeonOpenScheduleExcel(FlatBufferBuilder builder, SCHALE.Common.FlatData.WeekDay WeekDay_ = SCHALE.Common.FlatData.WeekDay.Sunday, VectorOffset OpenOffset = default(VectorOffset)) { builder.StartTable(2); WeekDungeonOpenScheduleExcel.AddOpen(builder, OpenOffset); WeekDungeonOpenScheduleExcel.AddWeekDay_(builder, WeekDay_); return WeekDungeonOpenScheduleExcel.EndWeekDungeonOpenScheduleExcel(builder); } public static void StartWeekDungeonOpenScheduleExcel(FlatBufferBuilder builder) { builder.StartTable(2); } public static void AddWeekDay_(FlatBufferBuilder builder, SCHALE.Common.FlatData.WeekDay weekDay_) { builder.AddInt(0, (int)weekDay_, 0); } public static void AddOpen(FlatBufferBuilder builder, VectorOffset openOffset) { builder.AddOffset(1, openOffset.Value, 0); } public static VectorOffset CreateOpenVector(FlatBufferBuilder builder, SCHALE.Common.FlatData.WeekDungeonType[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddInt((int)data[i]); return builder.EndVector(); } public static VectorOffset CreateOpenVectorBlock(FlatBufferBuilder builder, SCHALE.Common.FlatData.WeekDungeonType[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateOpenVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateOpenVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartOpenVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); } public static Offset EndWeekDungeonOpenScheduleExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public WeekDungeonOpenScheduleExcelT UnPack() { var _o = new WeekDungeonOpenScheduleExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(WeekDungeonOpenScheduleExcelT _o) { byte[] key = TableEncryptionService.CreateKey("WeekDungeonOpenSchedule"); _o.WeekDay_ = TableEncryptionService.Convert(this.WeekDay_, key); _o.Open = new List(); for (var _j = 0; _j < this.OpenLength; ++_j) {_o.Open.Add(TableEncryptionService.Convert(this.Open(_j), key));} } public static Offset Pack(FlatBufferBuilder builder, WeekDungeonOpenScheduleExcelT _o) { if (_o == null) return default(Offset); var _Open = default(VectorOffset); if (_o.Open != null) { var __Open = _o.Open.ToArray(); _Open = CreateOpenVector(builder, __Open); } return CreateWeekDungeonOpenScheduleExcel( builder, _o.WeekDay_, _Open); } } public class WeekDungeonOpenScheduleExcelT { public SCHALE.Common.FlatData.WeekDay WeekDay_ { get; set; } public List Open { get; set; } public WeekDungeonOpenScheduleExcelT() { this.WeekDay_ = SCHALE.Common.FlatData.WeekDay.Sunday; this.Open = null; } } static public class WeekDungeonOpenScheduleExcelVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*WeekDay_*/, 4 /*SCHALE.Common.FlatData.WeekDay*/, 4, false) && verifier.VerifyVectorOfData(tablePos, 6 /*Open*/, 4 /*SCHALE.Common.FlatData.WeekDungeonType*/, false) && verifier.VerifyTableEnd(tablePos); } } }