forked from Raphael/SCHALE.GameServer
68 lines
3.9 KiB
C#
68 lines
3.9 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::Google.FlatBuffers;
|
||
|
|
||
|
public struct Motion : IFlatbufferObject
|
||
|
{
|
||
|
private Table __p;
|
||
|
public ByteBuffer ByteBuffer { get { return __p.bb; } }
|
||
|
public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); }
|
||
|
public static Motion GetRootAsMotion(ByteBuffer _bb) { return GetRootAsMotion(_bb, new Motion()); }
|
||
|
public static Motion GetRootAsMotion(ByteBuffer _bb, Motion obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
|
||
|
public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
|
||
|
public Motion __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
|
||
|
|
||
|
public string Name { get { int o = __p.__offset(4); return o != 0 ? __p.__string(o + __p.bb_pos) : null; } }
|
||
|
#if ENABLE_SPAN_T
|
||
|
public Span<byte> GetNameBytes() { return __p.__vector_as_span<byte>(4, 1); }
|
||
|
#else
|
||
|
public ArraySegment<byte>? GetNameBytes() { return __p.__vector_as_arraysegment(4); }
|
||
|
#endif
|
||
|
public byte[] GetNameArray() { return __p.__vector_as_array<byte>(4); }
|
||
|
public SCHALE.Common.FlatData.Position? Positions(int j) { int o = __p.__offset(6); return o != 0 ? (SCHALE.Common.FlatData.Position?)(new SCHALE.Common.FlatData.Position()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
|
||
|
public int PositionsLength { get { int o = __p.__offset(6); return o != 0 ? __p.__vector_len(o) : 0; } }
|
||
|
|
||
|
public static Offset<SCHALE.Common.FlatData.Motion> CreateMotion(FlatBufferBuilder builder,
|
||
|
StringOffset NameOffset = default(StringOffset),
|
||
|
VectorOffset PositionsOffset = default(VectorOffset)) {
|
||
|
builder.StartTable(2);
|
||
|
Motion.AddPositions(builder, PositionsOffset);
|
||
|
Motion.AddName(builder, NameOffset);
|
||
|
return Motion.EndMotion(builder);
|
||
|
}
|
||
|
|
||
|
public static void StartMotion(FlatBufferBuilder builder) { builder.StartTable(2); }
|
||
|
public static void AddName(FlatBufferBuilder builder, StringOffset nameOffset) { builder.AddOffset(0, nameOffset.Value, 0); }
|
||
|
public static void AddPositions(FlatBufferBuilder builder, VectorOffset positionsOffset) { builder.AddOffset(1, positionsOffset.Value, 0); }
|
||
|
public static VectorOffset CreatePositionsVector(FlatBufferBuilder builder, Offset<SCHALE.Common.FlatData.Position>[] 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 CreatePositionsVectorBlock(FlatBufferBuilder builder, Offset<SCHALE.Common.FlatData.Position>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
|
||
|
public static VectorOffset CreatePositionsVectorBlock(FlatBufferBuilder builder, ArraySegment<Offset<SCHALE.Common.FlatData.Position>> data) { builder.StartVector(4, data.Count, 4); builder.Add(data); return builder.EndVector(); }
|
||
|
public static VectorOffset CreatePositionsVectorBlock(FlatBufferBuilder builder, IntPtr dataPtr, int sizeInBytes) { builder.StartVector(1, sizeInBytes, 1); builder.Add<Offset<SCHALE.Common.FlatData.Position>>(dataPtr, sizeInBytes); return builder.EndVector(); }
|
||
|
public static void StartPositionsVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
|
||
|
public static Offset<SCHALE.Common.FlatData.Motion> EndMotion(FlatBufferBuilder builder) {
|
||
|
int o = builder.EndTable();
|
||
|
return new Offset<SCHALE.Common.FlatData.Motion>(o);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
static public class MotionVerify
|
||
|
{
|
||
|
static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos)
|
||
|
{
|
||
|
return verifier.VerifyTableStart(tablePos)
|
||
|
&& verifier.VerifyString(tablePos, 4 /*Name*/, false)
|
||
|
&& verifier.VerifyVectorOfTables(tablePos, 6 /*Positions*/, SCHALE.Common.FlatData.PositionVerify.Verify, false)
|
||
|
&& verifier.VerifyTableEnd(tablePos);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|