//
// 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 EventContentBoxGachaShopExcel : IFlatbufferObject
{
private Table __p;
public ByteBuffer ByteBuffer { get { return __p.bb; } }
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
public static EventContentBoxGachaShopExcel GetRootAsEventContentBoxGachaShopExcel(ByteBuffer _bb) { return GetRootAsEventContentBoxGachaShopExcel(_bb, new EventContentBoxGachaShopExcel()); }
public static EventContentBoxGachaShopExcel GetRootAsEventContentBoxGachaShopExcel(ByteBuffer _bb, EventContentBoxGachaShopExcel obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
public EventContentBoxGachaShopExcel __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
public long EventContentId { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public long GroupId { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public long GroupElementAmount { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public long Round { get { int o = __p.__offset(10); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public bool IsLegacy { get { int o = __p.__offset(12); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public bool IsPrize { get { int o = __p.__offset(14); return o != 0 ? 0!=__p.bb.Get(o + __p.bb_pos) : (bool)false; } }
public long GoodsId(int j) { int o = __p.__offset(16); return o != 0 ? __p.bb.GetLong(__p.__vector(o) + j * 8) : (long)0; }
public int GoodsIdLength { get { int o = __p.__offset(16); return o != 0 ? __p.__vector_len(o) : 0; } }
#if ENABLE_SPAN_T
public Span GetGoodsIdBytes() { return __p.__vector_as_span(16, 8); }
#else
public ArraySegment? GetGoodsIdBytes() { return __p.__vector_as_arraysegment(16); }
#endif
public long[] GetGoodsIdArray() { return __p.__vector_as_array(16); }
public long DisplayOrder { get { int o = __p.__offset(18); return o != 0 ? __p.bb.GetLong(o + __p.bb_pos) : (long)0; } }
public static Offset CreateEventContentBoxGachaShopExcel(FlatBufferBuilder builder,
long EventContentId = 0,
long GroupId = 0,
long GroupElementAmount = 0,
long Round = 0,
bool IsLegacy = false,
bool IsPrize = false,
VectorOffset GoodsIdOffset = default(VectorOffset),
long DisplayOrder = 0) {
builder.StartTable(8);
EventContentBoxGachaShopExcel.AddDisplayOrder(builder, DisplayOrder);
EventContentBoxGachaShopExcel.AddRound(builder, Round);
EventContentBoxGachaShopExcel.AddGroupElementAmount(builder, GroupElementAmount);
EventContentBoxGachaShopExcel.AddGroupId(builder, GroupId);
EventContentBoxGachaShopExcel.AddEventContentId(builder, EventContentId);
EventContentBoxGachaShopExcel.AddGoodsId(builder, GoodsIdOffset);
EventContentBoxGachaShopExcel.AddIsPrize(builder, IsPrize);
EventContentBoxGachaShopExcel.AddIsLegacy(builder, IsLegacy);
return EventContentBoxGachaShopExcel.EndEventContentBoxGachaShopExcel(builder);
}
public static void StartEventContentBoxGachaShopExcel(FlatBufferBuilder builder) { builder.StartTable(8); }
public static void AddEventContentId(FlatBufferBuilder builder, long eventContentId) { builder.AddLong(0, eventContentId, 0); }
public static void AddGroupId(FlatBufferBuilder builder, long groupId) { builder.AddLong(1, groupId, 0); }
public static void AddGroupElementAmount(FlatBufferBuilder builder, long groupElementAmount) { builder.AddLong(2, groupElementAmount, 0); }
public static void AddRound(FlatBufferBuilder builder, long round) { builder.AddLong(3, round, 0); }
public static void AddIsLegacy(FlatBufferBuilder builder, bool isLegacy) { builder.AddBool(4, isLegacy, false); }
public static void AddIsPrize(FlatBufferBuilder builder, bool isPrize) { builder.AddBool(5, isPrize, false); }
public static void AddGoodsId(FlatBufferBuilder builder, VectorOffset goodsIdOffset) { builder.AddOffset(6, goodsIdOffset.Value, 0); }
public static VectorOffset CreateGoodsIdVector(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 CreateGoodsIdVectorBlock(FlatBufferBuilder builder, long[] data) { builder.StartVector(8, data.Length, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateGoodsIdVectorBlock(FlatBufferBuilder builder, ArraySegment data) { builder.StartVector(8, data.Count, 8); builder.Add(data); return builder.EndVector(); }
public static VectorOffset CreateGoodsIdVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add(dataPtr, sizeInBytes); return builder.EndVector(); }
public static void StartGoodsIdVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(8, numElems, 8); }
public static void AddDisplayOrder(FlatBufferBuilder builder, long displayOrder) { builder.AddLong(7, displayOrder, 0); }
public static Offset EndEventContentBoxGachaShopExcel(FlatBufferBuilder builder) {
int o = builder.EndTable();
return new Offset(o);
}
public EventContentBoxGachaShopExcelT UnPack() {
var _o = new EventContentBoxGachaShopExcelT();
this.UnPackTo(_o);
return _o;
}
public void UnPackTo(EventContentBoxGachaShopExcelT _o) {
byte[] key = TableEncryptionService.CreateKey("EventContentBoxGachaShop");
_o.EventContentId = TableEncryptionService.Convert(this.EventContentId, key);
_o.GroupId = TableEncryptionService.Convert(this.GroupId, key);
_o.GroupElementAmount = TableEncryptionService.Convert(this.GroupElementAmount, key);
_o.Round = TableEncryptionService.Convert(this.Round, key);
_o.IsLegacy = TableEncryptionService.Convert(this.IsLegacy, key);
_o.IsPrize = TableEncryptionService.Convert(this.IsPrize, key);
_o.GoodsId = new List();
for (var _j = 0; _j < this.GoodsIdLength; ++_j) {_o.GoodsId.Add(TableEncryptionService.Convert(this.GoodsId(_j), key));}
_o.DisplayOrder = TableEncryptionService.Convert(this.DisplayOrder, key);
}
public static Offset Pack(FlatBufferBuilder builder, EventContentBoxGachaShopExcelT _o) {
if (_o == null) return default(Offset);
var _GoodsId = default(VectorOffset);
if (_o.GoodsId != null) {
var __GoodsId = _o.GoodsId.ToArray();
_GoodsId = CreateGoodsIdVector(builder, __GoodsId);
}
return CreateEventContentBoxGachaShopExcel(
builder,
_o.EventContentId,
_o.GroupId,
_o.GroupElementAmount,
_o.Round,
_o.IsLegacy,
_o.IsPrize,
_GoodsId,
_o.DisplayOrder);
}
}
public class EventContentBoxGachaShopExcelT
{
public long EventContentId { get; set; }
public long GroupId { get; set; }
public long GroupElementAmount { get; set; }
public long Round { get; set; }
public bool IsLegacy { get; set; }
public bool IsPrize { get; set; }
public List GoodsId { get; set; }
public long DisplayOrder { get; set; }
public EventContentBoxGachaShopExcelT() {
this.EventContentId = 0;
this.GroupId = 0;
this.GroupElementAmount = 0;
this.Round = 0;
this.IsLegacy = false;
this.IsPrize = false;
this.GoodsId = null;
this.DisplayOrder = 0;
}
}
static public class EventContentBoxGachaShopExcelVerify
{
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
{
return verifier.VerifyTableStart(tablePos)
&& verifier.VerifyField(tablePos, 4 /*EventContentId*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 6 /*GroupId*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 8 /*GroupElementAmount*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 10 /*Round*/, 8 /*long*/, 8, false)
&& verifier.VerifyField(tablePos, 12 /*IsLegacy*/, 1 /*bool*/, 1, false)
&& verifier.VerifyField(tablePos, 14 /*IsPrize*/, 1 /*bool*/, 1, false)
&& verifier.VerifyVectorOfData(tablePos, 16 /*GoodsId*/, 8 /*long*/, false)
&& verifier.VerifyField(tablePos, 18 /*DisplayOrder*/, 8 /*long*/, 8, false)
&& verifier.VerifyTableEnd(tablePos);
}
}
}