SCHALE.GameServer/SCHALE.Common/FlatData/AcademyZoneExcel.cs

166 lines
10 KiB
C#

// <auto-generated>
// automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>
namespace SCHALE.Common.FlatData
{
using global::System;
using global::System.Collections.Generic;
using global::SCHALE.Common.Crypto;
using global::Google.FlatBuffers;
public struct AcademyZoneExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static AcademyZoneExcel GetRootAsAcademyZoneExcel(ByteBuffer _bb) { return GetRootAsAcademyZoneExcel(_bb, new AcademyZoneExcel()); }
public static AcademyZoneExcel GetRootAsAcademyZoneExcel(ByteBuffer _bb, AcademyZoneExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public AcademyZoneExcel __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 long LocationId { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public long LocationRankForUnlock { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public uint LocalizeEtcId { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
public long StudentVisitProb(int j) { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
public int StudentVisitProbLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<long> GetStudentVisitProbBytes() { return __p.__vector_as_span<long>(12, 8); }
#else
public ArraySegment<byte>? GetStudentVisitProbBytes() { return __p.__vector_as_arraysegment(12); }
#endif
public long[] GetStudentVisitProbArray() { return __p.__vector_as_array<long>(12); }
public long RewardGroupId { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public SCHALE.Common.FlatData.Tag Tags(int j) { int o = __p.__offset(16); return o != 0 ? (SCHALE.Common.FlatData.Tag)__p.bb.GetInt(__p.__vector(o) + j * 4) : (SCHALE.Common.FlatData.Tag)0; }
public int TagsLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<SCHALE.Common.FlatData.Tag> GetTagsBytes() { return __p.__vector_as_span<SCHALE.Common.FlatData.Tag>(16, 4); }
#else
public ArraySegment<byte>? GetTagsBytes() { return __p.__vector_as_arraysegment(16); }
#endif
public SCHALE.Common.FlatData.Tag[] GetTagsArray() { int o = __p.__offset(16); if (o == 0) return null; int p = __p.__vector(o); int l = __p.__vector_len(o); SCHALE.Common.FlatData.Tag[] a = new SCHALE.Common.FlatData.Tag[l]; for (int i = 0; i < l; i++) { a[i] = (SCHALE.Common.FlatData.Tag)__p.bb.GetInt(p + i * 4); } return a; }
public static Offset<SCHALE.Common.FlatData.AcademyZoneExcel> CreateAcademyZoneExcel(FlatBufferBuilder builder,
long Id = 0,
long LocationId = 0,
long LocationRankForUnlock = 0,
uint LocalizeEtcId = 0,
VectorOffset StudentVisitProbOffset = default(VectorOffset),
long RewardGroupId = 0,
VectorOffset TagsOffset = default(VectorOffset)) {
builder.StartTable(7);
AcademyZoneExcel.AddRewardGroupId(builder, RewardGroupId);
AcademyZoneExcel.AddLocationRankForUnlock(builder, LocationRankForUnlock);
AcademyZoneExcel.AddLocationId(builder, LocationId);
AcademyZoneExcel.AddId(builder, Id);
AcademyZoneExcel.AddTags(builder, TagsOffset);
AcademyZoneExcel.AddStudentVisitProb(builder, StudentVisitProbOffset);
AcademyZoneExcel.AddLocalizeEtcId(builder, LocalizeEtcId);
return AcademyZoneExcel.EndAcademyZoneExcel(builder);
}
public static void StartAcademyZoneExcel(FlatBufferBuilder builder) { builder.StartTable(7); }
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
public static void AddLocationId(FlatBufferBuilder builder, long locationId) { builder.AddLong(1, locationId, 0); }
public static void AddLocationRankForUnlock(FlatBufferBuilder builder, long locationRankForUnlock) { builder.AddLong(2, locationRankForUnlock, 0); }
public static void AddLocalizeEtcId(FlatBufferBuilder builder, uint localizeEtcId) { builder.AddUint(3, localizeEtcId, 0); }
public static void AddStudentVisitProb(FlatBufferBuilder builder, VectorOffset studentVisitProbOffset) { builder.AddOffset(4, studentVisitProbOffset.Value, 0); }
public static VectorOffset CreateStudentVisitProbVector(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 CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, ArraySegment<long> data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateStudentVisitProbVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<long>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartStudentVisitProbVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static void AddRewardGroupId(FlatBufferBuilder builder, long rewardGroupId) { builder.AddLong(5, rewardGroupId, 0); }
public static void AddTags(FlatBufferBuilder builder, VectorOffset tagsOffset) { builder.AddOffset(6, tagsOffset.Value, 0); }
public static VectorOffset CreateTagsVector(FlatBufferBuilder builder, SCHALE.Common.FlatData.Tag[] 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 CreateTagsVectorBlock(FlatBufferBuilder builder, SCHALE.Common.FlatData.Tag[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateTagsVectorBlock(FlatBufferBuilder builder, ArraySegment<SCHALE.Common.FlatData.Tag> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateTagsVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<SCHALE.Common.FlatData.Tag>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartTagsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static Offset<SCHALE.Common.FlatData.AcademyZoneExcel> EndAcademyZoneExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<SCHALE.Common.FlatData.AcademyZoneExcel>(o);
}
public AcademyZoneExcelT UnPack() {
var _o = new AcademyZoneExcelT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(AcademyZoneExcelT _o) {
byte[] key = TableEncryptionService.CreateKey("AcademyZone");
_o.Id = TableEncryptionService.Convert(this.Id, key);
_o.LocationId = TableEncryptionService.Convert(this.LocationId, key);
_o.LocationRankForUnlock = TableEncryptionService.Convert(this.LocationRankForUnlock, key);
_o.LocalizeEtcId = TableEncryptionService.Convert(this.LocalizeEtcId, key);
_o.StudentVisitProb = new List<long>();
for (var _j = 0; _j < this.StudentVisitProbLength; ++_j) {_o.StudentVisitProb.Add(TableEncryptionService.Convert(this.StudentVisitProb(_j), key));}
_o.RewardGroupId = TableEncryptionService.Convert(this.RewardGroupId, key);
_o.Tags = new List<SCHALE.Common.FlatData.Tag>();
for (var _j = 0; _j < this.TagsLength; ++_j) {_o.Tags.Add(TableEncryptionService.Convert(this.Tags(_j), key));}
}
public static Offset<SCHALE.Common.FlatData.AcademyZoneExcel> Pack(FlatBufferBuilder builder, AcademyZoneExcelT _o) {
if (_o == null) return default(Offset<SCHALE.Common.FlatData.AcademyZoneExcel>);
var _StudentVisitProb = default(VectorOffset);
if (_o.StudentVisitProb != null) {
var __StudentVisitProb = _o.StudentVisitProb.ToArray();
_StudentVisitProb = CreateStudentVisitProbVector(builder, __StudentVisitProb);
}
var _Tags = default(VectorOffset);
if (_o.Tags != null) {
var __Tags = _o.Tags.ToArray();
_Tags = CreateTagsVector(builder, __Tags);
}
return CreateAcademyZoneExcel(
builder,
_o.Id,
_o.LocationId,
_o.LocationRankForUnlock,
_o.LocalizeEtcId,
_StudentVisitProb,
_o.RewardGroupId,
_Tags);
}
}
public class AcademyZoneExcelT
{
public long Id { get; set; }
public long LocationId { get; set; }
public long LocationRankForUnlock { get; set; }
public uint LocalizeEtcId { get; set; }
public List<long> StudentVisitProb { get; set; }
public long RewardGroupId { get; set; }
public List<SCHALE.Common.FlatData.Tag> Tags { get; set; }
public AcademyZoneExcelT() {
this.Id = 0;
this.LocationId = 0;
this.LocationRankForUnlock = 0;
this.LocalizeEtcId = 0;
this.StudentVisitProb = null;
this.RewardGroupId = 0;
this.Tags = null;
}
}
static public class AcademyZoneExcelVerify
{
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 /*LocationId*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 8 /*LocationRankForUnlock*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 10 /*LocalizeEtcId*/, 4 /*uint*/, 4, false)
&& verifier.VerifyVectorOfData(tablePos, 12 /*StudentVisitProb*/, 8 /*long*/, false)
&& verifier.VerifyField(tablePos, 14 /*RewardGroupId*/, 8 /*long*/, 8, false)
&& verifier.VerifyVectorOfData(tablePos, 16 /*Tags*/, 4 /*SCHALE.Common.FlatData.Tag*/, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}