//
// 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 TutorialExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static TutorialExcel GetRootAsTutorialExcel(ByteBuffer _bb) { return GetRootAsTutorialExcel(_bb, new TutorialExcel()); }
public static TutorialExcel GetRootAsTutorialExcel(ByteBuffer _bb, TutorialExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public TutorialExcel __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 string CompletionReportEventName { get { int o = __p.__offset(6); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetCompletionReportEventNameBytes() { return __p.__vector_as_span(6, 1); }
#else
public ArraySegment? GetCompletionReportEventNameBytes() { return __p.__vector_as_arraysegment(6); }
#endif
public byte[] GetCompletionReportEventNameArray() { return __p.__vector_as_array(6); }
public bool CompulsoryTutorial { get { int o = __p.__offset(8); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public bool DescriptionTutorial { get { int o = __p.__offset(10); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public long TutorialStageId { get { int o = __p.__offset(12); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public string UIName(int j) { int o = __p.__offset(14); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
public int UINameLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }
public string TutorialParentName(int j) { int o = __p.__offset(16); return o != 0 ? __p.__string(__p.__vector(o) + j * 4) : null; }
public int TutorialParentNameLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
public static Offset CreateTutorialExcel(FlatBufferBuilder builder,
long ID = 0,
StringOffset CompletionReportEventNameOffset = default(StringOffset),
bool CompulsoryTutorial = false,
bool DescriptionTutorial = false,
long TutorialStageId = 0,
VectorOffset UINameOffset = default(VectorOffset),
VectorOffset TutorialParentNameOffset = default(VectorOffset)) {
builder.StartTable(7);
TutorialExcel.AddTutorialStageId(builder, TutorialStageId);
TutorialExcel.AddID(builder, ID);
TutorialExcel.AddTutorialParentName(builder, TutorialParentNameOffset);
TutorialExcel.AddUIName(builder, UINameOffset);
TutorialExcel.AddCompletionReportEventName(builder, CompletionReportEventNameOffset);
TutorialExcel.AddDescriptionTutorial(builder, DescriptionTutorial);
TutorialExcel.AddCompulsoryTutorial(builder, CompulsoryTutorial);
return TutorialExcel.EndTutorialExcel(builder);
}
public static void StartTutorialExcel(FlatBufferBuilder builder) { builder.StartTable(7); }
public static void AddID(FlatBufferBuilder builder, long iD) { builder.AddLong(0, iD, 0); }
public static void AddCompletionReportEventName(FlatBufferBuilder builder, StringOffset completionReportEventNameOffset) { builder.AddOffset(1, completionReportEventNameOffset.Value, 0); }
public static void AddCompulsoryTutorial(FlatBufferBuilder builder, bool compulsoryTutorial) { builder.AddBool(2, compulsoryTutorial, false); }
public static void AddDescriptionTutorial(FlatBufferBuilder builder, bool descriptionTutorial) { builder.AddBool(3, descriptionTutorial, false); }
public static void AddTutorialStageId(FlatBufferBuilder builder, long tutorialStageId) { builder.AddLong(4, tutorialStageId, 0); }
public static void AddUIName(FlatBufferBuilder builder, VectorOffset uINameOffset) { builder.AddOffset(5, uINameOffset.Value, 0); }
public static VectorOffset CreateUINameVector(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 CreateUINameVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateUINameVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateUINameVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartUINameVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static void AddTutorialParentName(FlatBufferBuilder builder, VectorOffset tutorialParentNameOffset) { builder.AddOffset(6, tutorialParentNameOffset.Value, 0); }
public static VectorOffset CreateTutorialParentNameVector(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 CreateTutorialParentNameVectorBlock(FlatBufferBuilder builder, StringOffset[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateTutorialParentNameVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateTutorialParentNameVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartTutorialParentNameVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
public static Offset EndTutorialExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset(o);
}
public TutorialExcelT UnPack() {
var _o = new TutorialExcelT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(TutorialExcelT _o) {
byte[] key = TableEncryptionService.CreateKey("Tutorial");
_o.ID = TableEncryptionService.Convert(this.ID, key);
_o.CompletionReportEventName = TableEncryptionService.Convert(this.CompletionReportEventName, key);
_o.CompulsoryTutorial = TableEncryptionService.Convert(this.CompulsoryTutorial, key);
_o.DescriptionTutorial = TableEncryptionService.Convert(this.DescriptionTutorial, key);
_o.TutorialStageId = TableEncryptionService.Convert(this.TutorialStageId, key);
_o.UIName = new List();
for (var _j = 0; _j < this.UINameLength; ++_j) {_o.UIName.Add(TableEncryptionService.Convert(this.UIName(_j), key));}
_o.TutorialParentName = new List();
for (var _j = 0; _j < this.TutorialParentNameLength; ++_j) {_o.TutorialParentName.Add(TableEncryptionService.Convert(this.TutorialParentName(_j), key));}
}
public static Offset Pack(FlatBufferBuilder builder, TutorialExcelT _o) {
if (_o == null) return default(Offset);
var _CompletionReportEventName = _o.CompletionReportEventName == null ? default(StringOffset) : builder.CreateString(_o.CompletionReportEventName);
var _UIName = default(VectorOffset);
if (_o.UIName != null) {
var __UIName = new StringOffset[_o.UIName.Count];
for (var _j = 0; _j < __UIName.Length; ++_j) { __UIName[_j] = builder.CreateString(_o.UIName[_j]); }
_UIName = CreateUINameVector(builder, __UIName);
}
var _TutorialParentName = default(VectorOffset);
if (_o.TutorialParentName != null) {
var __TutorialParentName = new StringOffset[_o.TutorialParentName.Count];
for (var _j = 0; _j < __TutorialParentName.Length; ++_j) { __TutorialParentName[_j] = builder.CreateString(_o.TutorialParentName[_j]); }
_TutorialParentName = CreateTutorialParentNameVector(builder, __TutorialParentName);
}
return CreateTutorialExcel(
builder,
_o.ID,
_CompletionReportEventName,
_o.CompulsoryTutorial,
_o.DescriptionTutorial,
_o.TutorialStageId,
_UIName,
_TutorialParentName);
}
}
public class TutorialExcelT
{
public long ID { get; set; }
public string CompletionReportEventName { get; set; }
public bool CompulsoryTutorial { get; set; }
public bool DescriptionTutorial { get; set; }
public long TutorialStageId { get; set; }
public List UIName { get; set; }
public List TutorialParentName { get; set; }
public TutorialExcelT() {
this.ID = 0;
this.CompletionReportEventName = null;
this.CompulsoryTutorial = false;
this.DescriptionTutorial = false;
this.TutorialStageId = 0;
this.UIName = null;
this.TutorialParentName = null;
}
}
static public class TutorialExcelVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*ID*/, 8 /*long*/, 8, false)
&& verifier.VerifyString(tablePos, 6 /*CompletionReportEventName*/, false)
&& verifier.VerifyField(tablePos, 8 /*CompulsoryTutorial*/, 1 /*bool*/, 1, false)
&& verifier.VerifyField(tablePos, 10 /*DescriptionTutorial*/, 1 /*bool*/, 1, false)
&& verifier.VerifyField(tablePos, 12 /*TutorialStageId*/, 8 /*long*/, 8, false)
&& verifier.VerifyVectorOfStrings(tablePos, 14 /*UIName*/, false)
&& verifier.VerifyVectorOfStrings(tablePos, 16 /*TutorialParentName*/, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}