// <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 NPorts : IFlatbufferObject
{
  private Table __p;
  public ByteBuffer ByteBuffer { get { return __p.bb; } }
  public static void ValidateVersion() { FlatBufferConstants.FLATBUFFERS_1_12_0(); }
  public static NPorts GetRootAsNPorts(ByteBuffer _bb) { return GetRootAsNPorts(_bb, new NPorts()); }
  public static NPorts GetRootAsNPorts(ByteBuffer _bb, NPorts obj) { return (obj.__assign(_bb.GetInt(_bb.Position) + _bb.Position, _bb)); }
  public void __init(int _i, ByteBuffer _bb) { __p = new Table(_i, _bb); }
  public NPorts __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  public NymaTypes.NPortInfo? Values(int j) { int o = __p.__offset(4); return o != 0 ? (NymaTypes.NPortInfo?)(new NymaTypes.NPortInfo()).__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.NPorts> CreateNPorts(FlatBufferBuilder builder,
      VectorOffset ValuesOffset = default(VectorOffset)) {
    builder.StartTable(1);
    NPorts.AddValues(builder, ValuesOffset);
    return NPorts.EndNPorts(builder);
  }

  public static void StartNPorts(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.NPortInfo>[] 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.NPortInfo>[] 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.NPorts> EndNPorts(FlatBufferBuilder builder) {
    int o = builder.EndTable();
    return new Offset<NymaTypes.NPorts>(o);
  }
  public NPortsT UnPack() {
    var _o = new NPortsT();
    this.UnPackTo(_o);
    return _o;
  }
  public void UnPackTo(NPortsT _o) {
    _o.Values = new List<NymaTypes.NPortInfoT>();
    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.NPorts> Pack(FlatBufferBuilder builder, NPortsT _o) {
    if (_o == null) return default(Offset<NymaTypes.NPorts>);
    var _Values = default(VectorOffset);
    if (_o.Values != null) {
      var __Values = new Offset<NymaTypes.NPortInfo>[_o.Values.Count];
      for (var _j = 0; _j < __Values.Length; ++_j) { __Values[_j] = NymaTypes.NPortInfo.Pack(builder, _o.Values[_j]); }
      _Values = CreateValuesVector(builder, __Values);
    }
    return CreateNPorts(
      builder,
      _Values);
  }
};

public class NPortsT
{
  public List<NymaTypes.NPortInfoT> Values { get; set; }

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


}
