//
// automatically generated by the FlatBuffers compiler, do not modify
//
namespace SCHALE.Common.FlatData
{
using global::System;
using global::System.Collections.Generic;
using global::Google.FlatBuffers;
public struct CampaignUnitExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static CampaignUnitExcel GetRootAsCampaignUnitExcel(ByteBuffer _bb) { return GetRootAsCampaignUnitExcel(_bb, new CampaignUnitExcel()); }
public static CampaignUnitExcel GetRootAsCampaignUnitExcel(ByteBuffer _bb, CampaignUnitExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public CampaignUnitExcel __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 uint Key { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetUint(o + __p.bb_pos) : (uint)0; } }
public string Name { get { int o = __p.__offset(8); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetNameBytes() { return __p.__vector_as_span(8, 1); }
#else
public ArraySegment? GetNameBytes() { return __p.__vector_as_arraysegment(8); }
#endif
public byte[] GetNameArray() { return __p.__vector_as_array(8); }
public string PrefabName { get { int o = __p.__offset(10); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetPrefabNameBytes() { return __p.__vector_as_span(10, 1); }
#else
public ArraySegment? GetPrefabNameBytes() { return __p.__vector_as_arraysegment(10); }
#endif
public byte[] GetPrefabNameArray() { return __p.__vector_as_array(10); }
public string StrategyPrefabName { get { int o = __p.__offset(12); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
#if ENABLE_SPAN_T
public Span GetStrategyPrefabNameBytes() { return __p.__vector_as_span(12, 1); }
#else
public ArraySegment? GetStrategyPrefabNameBytes() { return __p.__vector_as_arraysegment(12); }
#endif
public byte[] GetStrategyPrefabNameArray() { return __p.__vector_as_array(12); }
public long EnterScenarioGroupId(int j) { int o = __p.__offset(14); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
public int EnterScenarioGroupIdLength { get { int o = __p.__offset(14); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span GetEnterScenarioGroupIdBytes() { return __p.__vector_as_span(14, 8); }
#else
public ArraySegment? GetEnterScenarioGroupIdBytes() { return __p.__vector_as_arraysegment(14); }
#endif
public long[] GetEnterScenarioGroupIdArray() { return __p.__vector_as_array(14); }
public long ClearScenarioGroupId(int j) { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
public int ClearScenarioGroupIdLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span GetClearScenarioGroupIdBytes() { return __p.__vector_as_span(16, 8); }
#else
public ArraySegment? GetClearScenarioGroupIdBytes() { return __p.__vector_as_arraysegment(16); }
#endif
public long[] GetClearScenarioGroupIdArray() { return __p.__vector_as_array(16); }
public long GroundId { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public int MoveRange { get { int o = __p.__offset(20); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } }
public SCHALE.Common.FlatData.StrategyAIType AIMoveType { get { int o = __p.__offset(22); return o != 0 ? (SCHALE.Common.FlatData.StrategyAIType)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.StrategyAIType.None; } }
public SCHALE.Common.FlatData.HexaUnitGrade Grade { get { int o = __p.__offset(24); return o != 0 ? (SCHALE.Common.FlatData.HexaUnitGrade)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.HexaUnitGrade.Grade1; } }
public SCHALE.Common.FlatData.TacticEnvironment EnvironmentType { get { int o = __p.__offset(26); return o != 0 ? (SCHALE.Common.FlatData.TacticEnvironment)__p.bb.GetInt(o + __p.bb_pos) : SCHALE.Common.FlatData.TacticEnvironment.None; } }
public float Scale { get { int o = __p.__offset(28); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } }
public bool IsTacticSkip { get { int o = __p.__offset(30); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public static Offset CreateCampaignUnitExcel(FlatBufferBuilder builder,
long Id = 0,
uint Key = 0,
StringOffset NameOffset = default(StringOffset),
StringOffset PrefabNameOffset = default(StringOffset),
StringOffset StrategyPrefabNameOffset = default(StringOffset),
VectorOffset EnterScenarioGroupIdOffset = default(VectorOffset),
VectorOffset ClearScenarioGroupIdOffset = default(VectorOffset),
long GroundId = 0,
int MoveRange = 0,
SCHALE.Common.FlatData.StrategyAIType AIMoveType = SCHALE.Common.FlatData.StrategyAIType.None,
SCHALE.Common.FlatData.HexaUnitGrade Grade = SCHALE.Common.FlatData.HexaUnitGrade.Grade1,
SCHALE.Common.FlatData.TacticEnvironment EnvironmentType = SCHALE.Common.FlatData.TacticEnvironment.None,
float Scale = 0.0f,
bool IsTacticSkip = false) {
builder.StartTable(14);
CampaignUnitExcel.AddGroundId(builder, GroundId);
CampaignUnitExcel.AddId(builder, Id);
CampaignUnitExcel.AddScale(builder, Scale);
CampaignUnitExcel.AddEnvironmentType(builder, EnvironmentType);
CampaignUnitExcel.AddGrade(builder, Grade);
CampaignUnitExcel.AddAIMoveType(builder, AIMoveType);
CampaignUnitExcel.AddMoveRange(builder, MoveRange);
CampaignUnitExcel.AddClearScenarioGroupId(builder, ClearScenarioGroupIdOffset);
CampaignUnitExcel.AddEnterScenarioGroupId(builder, EnterScenarioGroupIdOffset);
CampaignUnitExcel.AddStrategyPrefabName(builder, StrategyPrefabNameOffset);
CampaignUnitExcel.AddPrefabName(builder, PrefabNameOffset);
CampaignUnitExcel.AddName(builder, NameOffset);
CampaignUnitExcel.AddKey(builder, Key);
CampaignUnitExcel.AddIsTacticSkip(builder, IsTacticSkip);
return CampaignUnitExcel.EndCampaignUnitExcel(builder);
}
public static void StartCampaignUnitExcel(FlatBufferBuilder builder) { builder.StartTable(14); }
public static void AddId(FlatBufferBuilder builder, long id) { builder.AddLong(0, id, 0); }
public static void AddKey(FlatBufferBuilder builder, uint key) { builder.AddUint(1, key, 0); }
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(2, nameOffset.Value, 0); }
public static void AddPrefabName(FlatBufferBuilder builder, StringOffset prefabNameOffset) { builder.AddOffset(3, prefabNameOffset.Value, 0); }
public static void AddStrategyPrefabName(FlatBufferBuilder builder, StringOffset strategyPrefabNameOffset) { builder.AddOffset(4, strategyPrefabNameOffset.Value, 0); }
public static void AddEnterScenarioGroupId(FlatBufferBuilder builder, VectorOffset enterScenarioGroupIdOffset) { builder.AddOffset(5, enterScenarioGroupIdOffset.Value, 0); }
public static VectorOffset CreateEnterScenarioGroupIdVector(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 CreateEnterScenarioGroupIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateEnterScenarioGroupIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateEnterScenarioGroupIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartEnterScenarioGroupIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static void AddClearScenarioGroupId(FlatBufferBuilder builder, VectorOffset clearScenarioGroupIdOffset) { builder.AddOffset(6, clearScenarioGroupIdOffset.Value, 0); }
public static VectorOffset CreateClearScenarioGroupIdVector(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 CreateClearScenarioGroupIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateClearScenarioGroupIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateClearScenarioGroupIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartClearScenarioGroupIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static void AddGroundId(FlatBufferBuilder builder, long groundId) { builder.AddLong(7, groundId, 0); }
public static void AddMoveRange(FlatBufferBuilder builder, int moveRange) { builder.AddInt(8, moveRange, 0); }
public static void AddAIMoveType(FlatBufferBuilder builder, SCHALE.Common.FlatData.StrategyAIType aIMoveType) { builder.AddInt(9, (int)aIMoveType, 0); }
public static void AddGrade(FlatBufferBuilder builder, SCHALE.Common.FlatData.HexaUnitGrade grade) { builder.AddInt(10, (int)grade, 0); }
public static void AddEnvironmentType(FlatBufferBuilder builder, SCHALE.Common.FlatData.TacticEnvironment environmentType) { builder.AddInt(11, (int)environmentType, 0); }
public static void AddScale(FlatBufferBuilder builder, float scale) { builder.AddFloat(12, scale, 0.0f); }
public static void AddIsTacticSkip(FlatBufferBuilder builder, bool isTacticSkip) { builder.AddBool(13, isTacticSkip, false); }
public static Offset EndCampaignUnitExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset(o);
}
}
static public class CampaignUnitExcelVerify
{
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 /*Key*/, 4 /*uint*/, 4, false)
&& verifier.VerifyString(tablePos, 8 /*Name*/, false)
&& verifier.VerifyString(tablePos, 10 /*PrefabName*/, false)
&& verifier.VerifyString(tablePos, 12 /*StrategyPrefabName*/, false)
&& verifier.VerifyVectorOfData(tablePos, 14 /*EnterScenarioGroupId*/, 8 /*long*/, false)
&& verifier.VerifyVectorOfData(tablePos, 16 /*ClearScenarioGroupId*/, 8 /*long*/, false)
&& verifier.VerifyField(tablePos, 18 /*GroundId*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 20 /*MoveRange*/, 4 /*int*/, 4, false)
&& verifier.VerifyField(tablePos, 22 /*AIMoveType*/, 4 /*SCHALE.Common.FlatData.StrategyAIType*/, 4, false)
&& verifier.VerifyField(tablePos, 24 /*Grade*/, 4 /*SCHALE.Common.FlatData.HexaUnitGrade*/, 4, false)
&& verifier.VerifyField(tablePos, 26 /*EnvironmentType*/, 4 /*SCHALE.Common.FlatData.TacticEnvironment*/, 4, false)
&& verifier.VerifyField(tablePos, 28 /*Scale*/, 4 /*float*/, 4, false)
&& verifier.VerifyField(tablePos, 30 /*IsTacticSkip*/, 1 /*bool*/, 1, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}