SCHALE.GameServer/SCHALE.Common/FlatData/VideoExcel.cs

174 lines
12 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 VideoExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static VideoExcel GetRootAsVideoExcel(ByteBuffer _bb) { return GetRootAsVideoExcel(_bb, new VideoExcel()); }
public static VideoExcel GetRootAsVideoExcel(ByteBuffer _bb, VideoExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public VideoExcel __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 SCHALE.Common.FlatData.Nation Nation_(int j) { int o = __p.__offset(6); return o != 0 ? (SCHALE.Common.FlatData.Nation)__p.bb.GetInt(__p.__vector(o) + j * 4) : (SCHALE.Common.FlatData.Nation)0; }
public int Nation_Length { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<SCHALE.Common.FlatData.Nation> GetNation_Bytes() { return __p.__vector_as_span<SCHALE.Common.FlatData.Nation>(6, 4); }
#else
public ArraySegment<byte>? GetNation_Bytes() { return __p.__vector_as_arraysegment(6); }
#endif
public SCHALE.Common.FlatData.Nation[] GetNation_Array() { int o = __p.__offset(6); if (o == 0) return null; int p = __p.__vector(o); int l = __p.__vector_len(o); SCHALE.Common.FlatData.Nation[] a = new SCHALE.Common.FlatData.Nation[l]; for (int i = 0; i < l; i++) { a[i] = (SCHALE.Common.FlatData.Nation)__p.bb.GetInt(p + i * 4); } return a; }
public string VideoPath(int j) { int o = __p.__offset(8); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
public int VideoPathLength { get { int o = __p.__offset(8); return o != 0 ? __p.__vector_len(o) : 0; } }
public string SoundPath(int j) { int o = __p.__offset(10); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
public int SoundPathLength { get { int o = __p.__offset(10); return o != 0 ? __p.__vector_len(o) : 0; } }
public float SoundVolume(int j) { int o = __p.__offset(12); return o != 0 ? __p.bb.GetFloat(__p.__vector(o) + j * 4) : (float)0; }
public int SoundVolumeLength { get { int o = __p.__offset(12); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span<float> GetSoundVolumeBytes() { return __p.__vector_as_span<float>(12, 4); }
#else
public ArraySegment<byte>? GetSoundVolumeBytes() { return __p.__vector_as_arraysegment(12); }
#endif
public float[] GetSoundVolumeArray() { return __p.__vector_as_array<float>(12); }
public static Offset<SCHALE.Common.FlatData.VideoExcel> CreateVideoExcel(FlatBufferBuilder builder,
long Id = 0,
VectorOffset Nation_Offset = default(VectorOffset),
VectorOffset VideoPathOffset = default(VectorOffset),
VectorOffset SoundPathOffset = default(VectorOffset),
VectorOffset SoundVolumeOffset = default(VectorOffset)) {
builder.StartTable(5);
VideoExcel.AddId(builder, Id);
VideoExcel.AddSoundVolume(builder, SoundVolumeOffset);
VideoExcel.AddSoundPath(builder, SoundPathOffset);
VideoExcel.AddVideoPath(builder, VideoPathOffset);
VideoExcel.AddNation_(builder, Nation_Offset);
return VideoExcel.EndVideoExcel(builder);
}
public static void StartVideoExcel(FlatBufferBuilder builder) { builder.StartTable(5); }
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
public static void AddNation_(FlatBufferBuilder builder, VectorOffset nation_Offset) { builder.AddOffset(1, nation_Offset.Value, 0); }
public static VectorOffset CreateNation_Vector(FlatBufferBuilder builder, SCHALE.Common.FlatData.Nation[] 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 CreateNation_VectorBlock(FlatBufferBuilder builder, SCHALE.Common.FlatData.Nation[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateNation_VectorBlock(FlatBufferBuilder builder, ArraySegment<SCHALE.Common.FlatData.Nation> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateNation_VectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<SCHALE.Common.FlatData.Nation>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartNation_Vector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddVideoPath(FlatBufferBuilder builder, VectorOffset videoPathOffset) { builder.AddOffset(2, videoPathOffset.Value, 0); }
public static VectorOffset CreateVideoPathVector(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 CreateVideoPathVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateVideoPathVectorBlock(FlatBufferBuilder builder, ArraySegment<StringOffset> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateVideoPathVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<StringOffset>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartVideoPathVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddSoundPath(FlatBufferBuilder builder, VectorOffset soundPathOffset) { builder.AddOffset(3, soundPathOffset.Value, 0); }
public static VectorOffset CreateSoundPathVector(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 CreateSoundPathVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateSoundPathVectorBlock(FlatBufferBuilder builder, ArraySegment<StringOffset> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateSoundPathVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<StringOffset>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartSoundPathVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddSoundVolume(FlatBufferBuilder builder, VectorOffset soundVolumeOffset) { builder.AddOffset(4, soundVolumeOffset.Value, 0); }
public static VectorOffset CreateSoundVolumeVector(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddFloat(data[i]); return builder.EndVector(); }
public static VectorOffset CreateSoundVolumeVectorBlock(FlatBufferBuilder builder, float[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateSoundVolumeVectorBlock(FlatBufferBuilder builder, ArraySegment<float> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateSoundVolumeVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<float>(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartSoundVolumeVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static Offset<SCHALE.Common.FlatData.VideoExcel> EndVideoExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset<SCHALE.Common.FlatData.VideoExcel>(o);
}
public VideoExcelT UnPack() {
var _o = new VideoExcelT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(VideoExcelT _o) {
byte[] key = TableEncryptionService.CreateKey("Video");
_o.Id = TableEncryptionService.Convert(this.Id, key);
_o.Nation_ = new List<SCHALE.Common.FlatData.Nation>();
for (var _j = 0; _j < this.Nation_Length; ++_j) {_o.Nation_.Add(TableEncryptionService.Convert(this.Nation_(_j), key));}
_o.VideoPath = new List<string>();
for (var _j = 0; _j < this.VideoPathLength; ++_j) {_o.VideoPath.Add(TableEncryptionService.Convert(this.VideoPath(_j), key));}
_o.SoundPath = new List<string>();
for (var _j = 0; _j < this.SoundPathLength; ++_j) {_o.SoundPath.Add(TableEncryptionService.Convert(this.SoundPath(_j), key));}
_o.SoundVolume = new List<float>();
for (var _j = 0; _j < this.SoundVolumeLength; ++_j) {_o.SoundVolume.Add(TableEncryptionService.Convert(this.SoundVolume(_j), key));}
}
public static Offset<SCHALE.Common.FlatData.VideoExcel> Pack(FlatBufferBuilder builder, VideoExcelT _o) {
if (_o == null) return default(Offset<SCHALE.Common.FlatData.VideoExcel>);
var _Nation_ = default(VectorOffset);
if (_o.Nation_ != null) {
var __Nation_ = _o.Nation_.ToArray();
_Nation_ = CreateNation_Vector(builder, __Nation_);
}
var _VideoPath = default(VectorOffset);
if (_o.VideoPath != null) {
var __VideoPath = new StringOffset[_o.VideoPath.Count];
for (var _j = 0; _j < __VideoPath.Length; ++_j) { __VideoPath[_j] = builder.CreateString(_o.VideoPath[_j]); }
_VideoPath = CreateVideoPathVector(builder, __VideoPath);
}
var _SoundPath = default(VectorOffset);
if (_o.SoundPath != null) {
var __SoundPath = new StringOffset[_o.SoundPath.Count];
for (var _j = 0; _j < __SoundPath.Length; ++_j) { __SoundPath[_j] = builder.CreateString(_o.SoundPath[_j]); }
_SoundPath = CreateSoundPathVector(builder, __SoundPath);
}
var _SoundVolume = default(VectorOffset);
if (_o.SoundVolume != null) {
var __SoundVolume = _o.SoundVolume.ToArray();
_SoundVolume = CreateSoundVolumeVector(builder, __SoundVolume);
}
return CreateVideoExcel(
builder,
_o.Id,
_Nation_,
_VideoPath,
_SoundPath,
_SoundVolume);
}
}
public class VideoExcelT
{
public long Id { get; set; }
public List<SCHALE.Common.FlatData.Nation> Nation_ { get; set; }
public List<string> VideoPath { get; set; }
public List<string> SoundPath { get; set; }
public List<float> SoundVolume { get; set; }
public VideoExcelT() {
this.Id = 0;
this.Nation_ = null;
this.VideoPath = null;
this.SoundPath = null;
this.SoundVolume = null;
}
}
static public class VideoExcelVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*Id*/, 8 /*long*/, 8, false)
&& verifier.VerifyVectorOfData(tablePos, 6 /*Nation_*/, 4 /*SCHALE.Common.FlatData.Nation*/, false)
&& verifier.VerifyVectorOfStrings(tablePos, 8 /*VideoPath*/, false)
&& verifier.VerifyVectorOfStrings(tablePos, 10 /*SoundPath*/, false)
&& verifier.VerifyVectorOfData(tablePos, 12 /*SoundVolume*/, 4 /*float*/, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}