// // 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 BlendInfo : IFlatbufferObject { private Table __p; public ByteBuffer ByteBuffer { get { return __p.bb; } } public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_24_3_25(); } public static BlendInfo GetRootAsBlendInfo(ByteBuffer _bb) { return GetRootAsBlendInfo(_bb, new BlendInfo()); } public static BlendInfo GetRootAsBlendInfo(ByteBuffer _bb, BlendInfo obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); } public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); } public BlendInfo __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } public int From { get { int o = __p.__offset(4); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public int To { get { int o = __p.__offset(6); return o != 0 ? __p.bb.GetInt(o + __p.bb_pos) : (int)0; } } public float Blend { get { int o = __p.__offset(8); return o != 0 ? __p.bb.GetFloat(o + __p.bb_pos) : (float)0.0f; } } public static Offset CreateBlendInfo(FlatBufferBuilder builder, int From = 0, int To = 0, float Blend = 0.0f) { builder.StartTable(3); BlendInfo.AddBlend(builder, Blend); BlendInfo.AddTo(builder, To); BlendInfo.AddFrom(builder, From); return BlendInfo.EndBlendInfo(builder); } public static void StartBlendInfo(FlatBufferBuilder builder) { builder.StartTable(3); } public static void AddFrom(FlatBufferBuilder builder, int from) { builder.AddInt(0, from, 0); } public static void AddTo(FlatBufferBuilder builder, int to) { builder.AddInt(1, to, 0); } public static void AddBlend(FlatBufferBuilder builder, float blend) { builder.AddFloat(2, blend, 0.0f); } public static Offset EndBlendInfo(FlatBufferBuilder builder) { int o = builder.EndTable(); return new Offset(o); } public BlendInfoT UnPack() { var _o = new BlendInfoT(); this.UnPackTo(_o); return _o; } public void UnPackTo(BlendInfoT _o) { byte[] key = { 0 }; _o.From = TableEncryptionService.Convert(this.From, key); _o.To = TableEncryptionService.Convert(this.To, key); _o.Blend = TableEncryptionService.Convert(this.Blend, key); } public static Offset Pack(FlatBufferBuilder builder, BlendInfoT _o) { if (_o == null) return default(Offset); return CreateBlendInfo( builder, _o.From, _o.To, _o.Blend); } } public class BlendInfoT { public int From { get; set; } public int To { get; set; } public float Blend { get; set; } public BlendInfoT() { this.From = 0; this.To = 0; this.Blend = 0.0f; } } static public class BlendInfoVerify { static public bool Verify(Google.FlatBuffers.Verifier verifier, uint tablePos) { return verifier.VerifyTableStart(tablePos) && verifier.VerifyField(tablePos, 4 /*From*/, 4 /*int*/, 4, false) && verifier.VerifyField(tablePos, 6 /*To*/, 4 /*int*/, 4, false) && verifier.VerifyField(tablePos, 8 /*Blend*/, 4 /*float*/, 4, false) && verifier.VerifyTableEnd(tablePos); } } }