//
// 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 OperatorExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static OperatorExcel GetRootAsOperatorExcel(ByteBuffer _bb) { return GetRootAsOperatorExcel(_bb, new OperatorExcel()); }
public static OperatorExcel GetRootAsOperatorExcel(ByteBuffer _bb, OperatorExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public OperatorExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public long UniqueId { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public string GroupId { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetGroupIdBytes() { return __p.__vector_as_span(6, 1); }
#else
public ArraySegment? GetGroupIdBytes() { return __p.__vector_as_arraysegment(6); }
#endif
public byte[] GetGroupIdArray() { return __p.__vector_as_array(6); }
public SCHALE.Common.FlatData.OperatorCondition OperatorCondition_ { get { int o = __p.__offset(8); return o != 0 ? (SCHALE.Common.FlatData.OperatorCondition)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.OperatorCondition.None; } }
public int OutputSequence { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public int RandomWeight { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public int OutputDelay { get { int o = __p.__offset(14); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public int Duration { get { int o = __p.__offset(16); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public int OperatorOutputPriority { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public string PortraitPath { get { int o = __p.__offset(20); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetPortraitPathBytes() { return __p.__vector_as_span(20, 1); }
#else
public ArraySegment? GetPortraitPathBytes() { return __p.__vector_as_arraysegment(20); }
#endif
public byte[] GetPortraitPathArray() { return __p.__vector_as_array(20); }
public string TextLocalizeKey { get { int o = __p.__offset(22); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetTextLocalizeKeyBytes() { return __p.__vector_as_span(22, 1); }
#else
public ArraySegment? GetTextLocalizeKeyBytes() { return __p.__vector_as_arraysegment(22); }
#endif
public byte[] GetTextLocalizeKeyArray() { return __p.__vector_as_array(22); }
public uint VoiceId(int j) { int o = __p.__offset(24); return o != 0 ? __p.bb.GetUint(__p.__vector(o) + j * 4) : (uint)0; }
public int VoiceIdLength { get { int o = __p.__offset(24); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span GetVoiceIdBytes() { return __p.__vector_as_span(24, 4); }
#else
public ArraySegment? GetVoiceIdBytes() { return __p.__vector_as_arraysegment(24); }
#endif
public uint[] GetVoiceIdArray() { return __p.__vector_as_array(24); }
public bool OperatorWaitQueue { get { int o = __p.__offset(26); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public static Offset CreateOperatorExcel(FlatBufferBuilder builder,
long UniqueId = 0,
StringOffset GroupIdOffset = default(StringOffset),
SCHALE.Common.FlatData.OperatorCondition OperatorCondition_ = SCHALE.Common.FlatData.OperatorCondition.None,
int OutputSequence = 0,
int RandomWeight = 0,
int OutputDelay = 0,
int Duration = 0,
int OperatorOutputPriority = 0,
StringOffset PortraitPathOffset = default(StringOffset),
StringOffset TextLocalizeKeyOffset = default(StringOffset),
VectorOffset VoiceIdOffset = default(VectorOffset),
bool OperatorWaitQueue = false) {
builder.StartTable(12);
OperatorExcel.AddUniqueId(builder, UniqueId);
OperatorExcel.AddVoiceId(builder, VoiceIdOffset);
OperatorExcel.AddTextLocalizeKey(builder, TextLocalizeKeyOffset);
OperatorExcel.AddPortraitPath(builder, PortraitPathOffset);
OperatorExcel.AddOperatorOutputPriority(builder, OperatorOutputPriority);
OperatorExcel.AddDuration(builder, Duration);
OperatorExcel.AddOutputDelay(builder, OutputDelay);
OperatorExcel.AddRandomWeight(builder, RandomWeight);
OperatorExcel.AddOutputSequence(builder, OutputSequence);
OperatorExcel.AddOperatorCondition_(builder, OperatorCondition_);
OperatorExcel.AddGroupId(builder, GroupIdOffset);
OperatorExcel.AddOperatorWaitQueue(builder, OperatorWaitQueue);
return OperatorExcel.EndOperatorExcel(builder);
}
public static void StartOperatorExcel(FlatBufferBuilder builder) { builder.StartTable(12); }
public static void AddUniqueId(FlatBufferBuilder builder, long uniqueId) { builder.AddLong(0, uniqueId, 0); }
public static void AddGroupId(FlatBufferBuilder builder, StringOffset groupIdOffset) { builder.AddOffset(1, groupIdOffset.Value, 0); }
public static void AddOperatorCondition_(FlatBufferBuilder builder, SCHALE.Common.FlatData.OperatorCondition operatorCondition_) { builder.AddInt(2, (int)operatorCondition_, 0); }
public static void AddOutputSequence(FlatBufferBuilder builder, int outputSequence) { builder.AddInt(3, outputSequence, 0); }
public static void AddRandomWeight(FlatBufferBuilder builder, int randomWeight) { builder.AddInt(4, randomWeight, 0); }
public static void AddOutputDelay(FlatBufferBuilder builder, int outputDelay) { builder.AddInt(5, outputDelay, 0); }
public static void AddDuration(FlatBufferBuilder builder, int duration) { builder.AddInt(6, duration, 0); }
public static void AddOperatorOutputPriority(FlatBufferBuilder builder, int operatorOutputPriority) { builder.AddInt(7, operatorOutputPriority, 0); }
public static void AddPortraitPath(FlatBufferBuilder builder, StringOffset portraitPathOffset) { builder.AddOffset(8, portraitPathOffset.Value, 0); }
public static void AddTextLocalizeKey(FlatBufferBuilder builder, StringOffset textLocalizeKeyOffset) { builder.AddOffset(9, textLocalizeKeyOffset.Value, 0); }
public static void AddVoiceId(FlatBufferBuilder builder, VectorOffset voiceIdOffset) { builder.AddOffset(10, voiceIdOffset.Value, 0); }
public static VectorOffset CreateVoiceIdVector(FlatBufferBuilder builder, uint[] data) { builder.StartVector(4, data.Length, 4); for (int i = data.Length - 1; i >= 0; i--) builder.AddUint(data[i]); return builder.EndVector(); }
public static VectorOffset CreateVoiceIdVectorBlock(FlatBufferBuilder builder, uint[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateVoiceIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateVoiceIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartVoiceIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddOperatorWaitQueue(FlatBufferBuilder builder, bool operatorWaitQueue) { builder.AddBool(11, operatorWaitQueue, false); }
public static Offset EndOperatorExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset(o);
}
public OperatorExcelT UnPack() {
var _o = new OperatorExcelT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(OperatorExcelT _o) {
byte[] key = TableEncryptionService.CreateKey("Operator");
_o.UniqueId = TableEncryptionService.Convert(this.UniqueId, key);
_o.GroupId = TableEncryptionService.Convert(this.GroupId, key);
_o.OperatorCondition_ = TableEncryptionService.Convert(this.OperatorCondition_, key);
_o.OutputSequence = TableEncryptionService.Convert(this.OutputSequence, key);
_o.RandomWeight = TableEncryptionService.Convert(this.RandomWeight, key);
_o.OutputDelay = TableEncryptionService.Convert(this.OutputDelay, key);
_o.Duration = TableEncryptionService.Convert(this.Duration, key);
_o.OperatorOutputPriority = TableEncryptionService.Convert(this.OperatorOutputPriority, key);
_o.PortraitPath = TableEncryptionService.Convert(this.PortraitPath, key);
_o.TextLocalizeKey = TableEncryptionService.Convert(this.TextLocalizeKey, key);
_o.VoiceId = new List();
for (var _j = 0; _j < this.VoiceIdLength; ++_j) {_o.VoiceId.Add(TableEncryptionService.Convert(this.VoiceId(_j), key));}
_o.OperatorWaitQueue = TableEncryptionService.Convert(this.OperatorWaitQueue, key);
}
public static Offset Pack(FlatBufferBuilder builder, OperatorExcelT _o) {
if (_o == null) return default(Offset);
var _GroupId = _o.GroupId == null ? default(StringOffset) : builder.CreateString(_o.GroupId);
var _PortraitPath = _o.PortraitPath == null ? default(StringOffset) : builder.CreateString(_o.PortraitPath);
var _TextLocalizeKey = _o.TextLocalizeKey == null ? default(StringOffset) : builder.CreateString(_o.TextLocalizeKey);
var _VoiceId = default(VectorOffset);
if (_o.VoiceId != null) {
var __VoiceId = _o.VoiceId.ToArray();
_VoiceId = CreateVoiceIdVector(builder, __VoiceId);
}
return CreateOperatorExcel(
builder,
_o.UniqueId,
_GroupId,
_o.OperatorCondition_,
_o.OutputSequence,
_o.RandomWeight,
_o.OutputDelay,
_o.Duration,
_o.OperatorOutputPriority,
_PortraitPath,
_TextLocalizeKey,
_VoiceId,
_o.OperatorWaitQueue);
}
}
public class OperatorExcelT
{
public long UniqueId { get; set; }
public string GroupId { get; set; }
public SCHALE.Common.FlatData.OperatorCondition OperatorCondition_ { get; set; }
public int OutputSequence { get; set; }
public int RandomWeight { get; set; }
public int OutputDelay { get; set; }
public int Duration { get; set; }
public int OperatorOutputPriority { get; set; }
public string PortraitPath { get; set; }
public string TextLocalizeKey { get; set; }
public List VoiceId { get; set; }
public bool OperatorWaitQueue { get; set; }
public OperatorExcelT() {
this.UniqueId = 0;
this.GroupId = null;
this.OperatorCondition_ = SCHALE.Common.FlatData.OperatorCondition.None;
this.OutputSequence = 0;
this.RandomWeight = 0;
this.OutputDelay = 0;
this.Duration = 0;
this.OperatorOutputPriority = 0;
this.PortraitPath = null;
this.TextLocalizeKey = null;
this.VoiceId = null;
this.OperatorWaitQueue = false;
}
}
static public class OperatorExcelVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*UniqueId*/, 8 /*long*/, 8, false)
&& verifier.VerifyString(tablePos, 6 /*GroupId*/, false)
&& verifier.VerifyField(tablePos, 8 /*OperatorCondition_*/, 4 /*SCHALE.Common.FlatData.OperatorCondition*/, 4, false)
&& verifier.VerifyField(tablePos, 10 /*OutputSequence*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 12 /*RandomWeight*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 14 /*OutputDelay*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 16 /*Duration*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 18 /*OperatorOutputPriority*/, 4 /*int*/, 4, false)
&& verifier.VerifyString(tablePos, 20 /*PortraitPath*/, false)
&& verifier.VerifyString(tablePos, 22 /*TextLocalizeKey*/, false)
&& verifier.VerifyVectorOfData(tablePos, 24 /*VoiceId*/, 4 /*uint*/, false)
&& verifier.VerifyField(tablePos, 26 /*OperatorWaitQueue*/, 1 /*bool*/, 1, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}