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

package scrabblefb

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

type EvalResult struct {
	_tab flatbuffers.Table
}

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

func FinishEvalResultBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.Finish(offset)
}

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

func FinishSizePrefixedEvalResultBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
	builder.FinishSizePrefixed(offset)
}

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

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

func (rcv *EvalResult) Legal() bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetBool(o + rcv._tab.Pos)
	}
	return false
}

func (rcv *EvalResult) MutateLegal(n bool) bool {
	return rcv._tab.MutateBoolSlot(4, n)
}

func (rcv *EvalResult) Score() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *EvalResult) MutateScore(n int32) bool {
	return rcv._tab.MutateInt32Slot(6, n)
}

func (rcv *EvalResult) Words(j int) []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		a := rcv._tab.Vector(o)
		return rcv._tab.ByteVector(a + flatbuffers.UOffsetT(j*4))
	}
	return nil
}

func (rcv *EvalResult) WordsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

func (rcv *EvalResult) Dir() []byte {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.ByteVector(o + rcv._tab.Pos)
	}
	return nil
}

func EvalResultStart(builder *flatbuffers.Builder) {
	builder.StartObject(4)
}
func EvalResultAddLegal(builder *flatbuffers.Builder, legal bool) {
	builder.PrependBoolSlot(0, legal, false)
}
func EvalResultAddScore(builder *flatbuffers.Builder, score int32) {
	builder.PrependInt32Slot(1, score, 0)
}
func EvalResultAddWords(builder *flatbuffers.Builder, words flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(words), 0)
}
func EvalResultStartWordsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func EvalResultAddDir(builder *flatbuffers.Builder, dir flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(dir), 0)
}
func EvalResultEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
