// Code generated by the FlatBuffers compiler. DO NOT EDIT.

package fbsemantic

import (
	flatbuffers "github.com/google/flatbuffers/go"
)

type PolyType struct {
	_tab flatbuffers.Table
}

func GetRootAsPolyType(buf []byte, offset flatbuffers.UOffsetT) *PolyType {
	n := flatbuffers.GetUOffsetT(buf[offset:])
	x := &PolyType{}
	x.Init(buf, n+offset)
	return x
}

func (rcv *PolyType) Init(buf []byte, i flatbuffers.UOffsetT) {
	rcv._tab.Bytes = buf
	rcv._tab.Pos = i
}

func (rcv *PolyType) Table() flatbuffers.Table {
	return rcv._tab
}

func (rcv *PolyType) Vars(obj *Var, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *PolyType) VarsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *PolyType) Cons(obj *Constraint, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		x := rcv._tab.Vector(o)
		x += flatbuffers.UOffsetT(j) * 4
		x = rcv._tab.Indirect(x)
		obj.Init(rcv._tab.Bytes, x)
		return true
	}
	return false
}

func (rcv *PolyType) ConsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *PolyType) ExprType() byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetByte(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *PolyType) MutateExprType(n byte) bool {
	return rcv._tab.MutateByteSlot(8, n)
}

func (rcv *PolyType) Expr(obj *flatbuffers.Table) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		rcv._tab.Union(obj, o)
		return true
	}
	return false
}

func PolyTypeStart(builder *flatbuffers.Builder) {
	builder.StartObject(4)
}
func PolyTypeAddVars(builder *flatbuffers.Builder, vars flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(vars), 0)
}
func PolyTypeStartVarsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func PolyTypeAddCons(builder *flatbuffers.Builder, cons flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(cons), 0)
}
func PolyTypeStartConsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func PolyTypeAddExprType(builder *flatbuffers.Builder, exprType byte) {
	builder.PrependByteSlot(2, exprType, 0)
}
func PolyTypeAddExpr(builder *flatbuffers.Builder, expr flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(expr), 0)
}
func PolyTypeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
