// <auto-generated>
//  automatically generated by the FlatBuffers compiler, do not modify
// </auto-generated>

namespace NymaTypes
{

using global::System;
using global::System.Collections.Generic;
using global::FlatBuffers;

public struct Settings : IFlatbufferObject
{
  private Table __p;
  public ByteBuffer ByteBuffer { get { return __p.bb; } }
  public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
  public static Settings GetRootAsSettings(ByteBuffer _bb) { return GetRootAsSettings(_bb, new Settings()); }
  public static Settings GetRootAsSettings(ByteBuffer _bb, Settings obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
  public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
  public Settings __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public NymaTypes.Setting? Values(int j) { int o = __p.__offset(4); return o != 0 ? (NymaTypes.Setting?)(new NymaTypes.Setting()).__assign(__p.__indirect(__p.__vector(o) + j * 4), __p.bb) : null; }
  public int ValuesLength { get { int o = __p.__offset(4); return o != 0 ? __p.__vector_len(o) : 0; } }

  public static Offset<NymaTypes.Settings> CreateSettings(FlatBufferBuilder builder,
      VectorOffset ValuesOffset = default(VectorOffset)) {
    builder.StartTable(1);
    Settings.AddValues(builder, ValuesOffset);
    return Settings.EndSettings(builder);
  }

  public static void StartSettings(FlatBufferBuilder builder) { builder.StartTable(1); }
  public static void AddValues(FlatBufferBuilder builder, VectorOffset ValuesOffset) { builder.AddOffset(0, ValuesOffset.Value, 0); }
  public static VectorOffset CreateValuesVector(FlatBufferBuilder builder, Offset<NymaTypes.Setting>[] 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 CreateValuesVectorBlock(FlatBufferBuilder builder, Offset<NymaTypes.Setting>[] data) { builder.StartVector(4, data.Length, 4); builder.Add(data); return builder.EndVector(); }
  public static void StartValuesVector(FlatBufferBuilder builder, int numElems) { builder.StartVector(4, numElems, 4); }
  public static Offset<NymaTypes.Settings> EndSettings(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<NymaTypes.Settings>(o);
  }
  public SettingsT UnPack() {
    var _o = new SettingsT();
    this.UnPackTo(_o);
    return _o;
  }
  public void UnPackTo(SettingsT _o) {
    _o.Values = new List<NymaTypes.SettingT>();
    for (var _j = 0; _j < this.ValuesLength; ++_j) {_o.Values.Add(this.Values(_j).HasValue ? this.Values(_j).Value.UnPack() : null);}
  }
  public static Offset<NymaTypes.Settings> Pack(FlatBufferBuilder builder, SettingsT _o) {
    if (_o == null) return default(Offset<NymaTypes.Settings>);
    var _Values = default(VectorOffset);
    if (_o.Values != null) {
      var __Values = new Offset<NymaTypes.Setting>[_o.Values.Count];
      for (var _j = 0; _j < __Values.Length; ++_j) { __Values[_j] = NymaTypes.Setting.Pack(builder, _o.Values[_j]); }
      _Values = CreateValuesVector(builder, __Values);
    }
    return CreateSettings(
      builder,
      _Values);
  }
};

public class SettingsT
{
  public List<NymaTypes.SettingT> Values { get; set; }

  public SettingsT() {
    this.Values = null;
  }
}


}
