// // 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 EchelonConstraintExcel : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static EchelonConstraintExcel GetRootAsEchelonConstraintExcel(ByteBuffer _bb) { return GetRootAsEchelonConstraintExcel(_bb, new EchelonConstraintExcel()); } public static EchelonConstraintExcel GetRootAsEchelonConstraintExcel(ByteBuffer _bb, EchelonConstraintExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public EchelonConstraintExcel __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 bool IsWhiteList { get { int o = __p.__offset(6); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } } public long CharacterId(int j) { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int CharacterIdLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetCharacterIdBytes() { return __p.__vector_as_span(8, 8); } #else public ArraySegment? GetCharacterIdBytes() { return __p.__vector_as_arraysegment(8); } #endif public long[] GetCharacterIdArray() { return __p.__vector_as_array(8); } public long PersonalityId(int j) { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; } public int PersonalityIdLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } } #if ENABLE_SPAN_T public Span GetPersonalityIdBytes() { return __p.__vector_as_span(10, 8); } #else public ArraySegment? GetPersonalityIdBytes() { return __p.__vector_as_arraysegment(10); } #endif public long[] GetPersonalityIdArray() { return __p.__vector_as_array(10); } public SCHALE.Common.FlatData.WeaponType WeaponType_ { get { int o = __p.__offset(12); return o != 0 ? (SCHALE.Common.FlatData.WeaponType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.WeaponType.None; } } public SCHALE.Common.FlatData.School School_ { get { int o = __p.__offset(14); return o != 0 ? (SCHALE.Common.FlatData.School)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.School.None; } } public SCHALE.Common.FlatData.Club Club_ { get { int o = __p.__offset(16); return o != 0 ? (SCHALE.Common.FlatData.Club)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.Club.None; } } public SCHALE.Common.FlatData.TacticRole Role { get { int o = __p.__offset(18); return o != 0 ? (SCHALE.Common.FlatData.TacticRole)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.TacticRole.None; } } public static Offset CreateEchelonConstraintExcel(FlatBufferBuilder builder, long GroupId = 0, bool IsWhiteList = false, VectorOffset CharacterIdOffset = default(VectorOffset), VectorOffset PersonalityIdOffset = default(VectorOffset), SCHALE.Common.FlatData.WeaponType WeaponType_ = SCHALE.Common.FlatData.WeaponType.None, SCHALE.Common.FlatData.School School_ = SCHALE.Common.FlatData.School.None, SCHALE.Common.FlatData.Club Club_ = SCHALE.Common.FlatData.Club.None, SCHALE.Common.FlatData.TacticRole Role = SCHALE.Common.FlatData.TacticRole.None) { builder.StartTable(8); EchelonConstraintExcel.AddGroupId(builder, GroupId); EchelonConstraintExcel.AddRole(builder, Role); EchelonConstraintExcel.AddClub_(builder, Club_); EchelonConstraintExcel.AddSchool_(builder, School_); EchelonConstraintExcel.AddWeaponType_(builder, WeaponType_); EchelonConstraintExcel.AddPersonalityId(builder, PersonalityIdOffset); EchelonConstraintExcel.AddCharacterId(builder, CharacterIdOffset); EchelonConstraintExcel.AddIsWhiteList(builder, IsWhiteList); return EchelonConstraintExcel.EndEchelonConstraintExcel(builder); } public static void StartEchelonConstraintExcel(FlatBufferBuilder builder) { builder.StartTable(8); } public static void AddGroupId(FlatBufferBuilder builder, long groupId) { builder.AddLong(0, groupId, 0); } public static void AddIsWhiteList(FlatBufferBuilder builder, bool isWhiteList) { builder.AddBool(1, isWhiteList, false); } public static void AddCharacterId(FlatBufferBuilder builder, VectorOffset characterIdOffset) { builder.AddOffset(2, characterIdOffset.Value, 0); } public static VectorOffset CreateCharacterIdVector(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 CreateCharacterIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateCharacterIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreateCharacterIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartCharacterIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddPersonalityId(FlatBufferBuilder builder, VectorOffset personalityIdOffset) { builder.AddOffset(3, personalityIdOffset.Value, 0); } public static VectorOffset CreatePersonalityIdVector(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 CreatePersonalityIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreatePersonalityIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); } public static VectorOffset CreatePersonalityIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); } public static void StartPersonalityIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); } public static void AddWeaponType_(FlatBufferBuilder builder, SCHALE.Common.FlatData.WeaponType weaponType_) { builder.AddInt(4, (int)weaponType_, 0); } public static void AddSchool_(FlatBufferBuilder builder, SCHALE.Common.FlatData.School school_) { builder.AddInt(5, (int)school_, 0); } public static void AddClub_(FlatBufferBuilder builder, SCHALE.Common.FlatData.Club club_) { builder.AddInt(6, (int)club_, 0); } public static void AddRole(FlatBufferBuilder builder, SCHALE.Common.FlatData.TacticRole role) { builder.AddInt(7, (int)role, 0); } public static Offset EndEchelonConstraintExcel(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public EchelonConstraintExcelT UnPack() { var _o = new EchelonConstraintExcelT(); this.UnPackTo(_o); return _o; } public void UnPackTo(EchelonConstraintExcelT _o) { byte[] key = TableEncryptionService.CreateKey("EchelonConstraint"); _o.GroupId = TableEncryptionService.Convert(this.GroupId, key); _o.IsWhiteList = TableEncryptionService.Convert(this.IsWhiteList, key); _o.CharacterId = new List(); for (var _j = 0; _j < this.CharacterIdLength; ++_j) {_o.CharacterId.Add(TableEncryptionService.Convert(this.CharacterId(_j), key));} _o.PersonalityId = new List(); for (var _j = 0; _j < this.PersonalityIdLength; ++_j) {_o.PersonalityId.Add(TableEncryptionService.Convert(this.PersonalityId(_j), key));} _o.WeaponType_ = TableEncryptionService.Convert(this.WeaponType_, key); _o.School_ = TableEncryptionService.Convert(this.School_, key); _o.Club_ = TableEncryptionService.Convert(this.Club_, key); _o.Role = TableEncryptionService.Convert(this.Role, key); } public static Offset Pack(FlatBufferBuilder builder, EchelonConstraintExcelT _o) { if (_o == null) return default(Offset); var _CharacterId = default(VectorOffset); if (_o.CharacterId != null) { var __CharacterId = _o.CharacterId.ToArray(); _CharacterId = CreateCharacterIdVector(builder, __CharacterId); } var _PersonalityId = default(VectorOffset); if (_o.PersonalityId != null) { var __PersonalityId = _o.PersonalityId.ToArray(); _PersonalityId = CreatePersonalityIdVector(builder, __PersonalityId); } return CreateEchelonConstraintExcel( builder, _o.GroupId, _o.IsWhiteList, _CharacterId, _PersonalityId, _o.WeaponType_, _o.School_, _o.Club_, _o.Role); } } public class EchelonConstraintExcelT { public long GroupId { get; set; } public bool IsWhiteList { get; set; } public List CharacterId { get; set; } public List PersonalityId { get; set; } public SCHALE.Common.FlatData.WeaponType WeaponType_ { get; set; } public SCHALE.Common.FlatData.School School_ { get; set; } public SCHALE.Common.FlatData.Club Club_ { get; set; } public SCHALE.Common.FlatData.TacticRole Role { get; set; } public EchelonConstraintExcelT() { this.GroupId = 0; this.IsWhiteList = false; this.CharacterId = null; this.PersonalityId = null; this.WeaponType_ = SCHALE.Common.FlatData.WeaponType.None; this.School_ = SCHALE.Common.FlatData.School.None; this.Club_ = SCHALE.Common.FlatData.Club.None; this.Role = SCHALE.Common.FlatData.TacticRole.None; } } static public class EchelonConstraintExcelVerify { 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 /*IsWhiteList*/, 1 /*bool*/, 1, false) && verifier.VerifyVectorOfData(tablePos, 8 /*CharacterId*/, 8 /*long*/, false) && verifier.VerifyVectorOfData(tablePos, 10 /*PersonalityId*/, 8 /*long*/, false) && verifier.VerifyField(tablePos, 12 /*WeaponType_*/, 4 /*SCHALE.Common.FlatData.WeaponType*/, 4, false) && verifier.VerifyField(tablePos, 14 /*School_*/, 4 /*SCHALE.Common.FlatData.School*/, 4, false) && verifier.VerifyField(tablePos, 16 /*Club_*/, 4 /*SCHALE.Common.FlatData.Club*/, 4, false) && verifier.VerifyField(tablePos, 18 /*Role*/, 4 /*SCHALE.Common.FlatData.TacticRole*/, 4, false) && verifier.VerifyTableEnd(tablePos); } } }