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

package scrabblefb

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

type MoveRecord struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

func (rcv *MoveRecord) Player() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *MoveRecord) MutatePlayer(n int32) bool {
	return rcv._tab.MutateInt32Slot(4, n)
}

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

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

func (rcv *MoveRecord) MainRow() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *MoveRecord) MutateMainRow(n int32) bool {
	return rcv._tab.MutateInt32Slot(10, n)
}

func (rcv *MoveRecord) MainCol() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *MoveRecord) MutateMainCol(n int32) bool {
	return rcv._tab.MutateInt32Slot(12, n)
}

func (rcv *MoveRecord) Tiles(obj *TileRecord, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
	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 *MoveRecord) TilesLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

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

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

func (rcv *MoveRecord) Count() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(18))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *MoveRecord) MutateCount(n int32) bool {
	return rcv._tab.MutateInt32Slot(18, n)
}

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

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

func (rcv *MoveRecord) Total() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(22))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *MoveRecord) MutateTotal(n int32) bool {
	return rcv._tab.MutateInt32Slot(22, n)
}

func MoveRecordStart(builder *flatbuffers.Builder) {
	builder.StartObject(10)
}
func MoveRecordAddPlayer(builder *flatbuffers.Builder, player int32) {
	builder.PrependInt32Slot(0, player, 0)
}
func MoveRecordAddAction(builder *flatbuffers.Builder, action flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(action), 0)
}
func MoveRecordAddDir(builder *flatbuffers.Builder, dir flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(dir), 0)
}
func MoveRecordAddMainRow(builder *flatbuffers.Builder, mainRow int32) {
	builder.PrependInt32Slot(3, mainRow, 0)
}
func MoveRecordAddMainCol(builder *flatbuffers.Builder, mainCol int32) {
	builder.PrependInt32Slot(4, mainCol, 0)
}
func MoveRecordAddTiles(builder *flatbuffers.Builder, tiles flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(tiles), 0)
}
func MoveRecordStartTilesVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func MoveRecordAddWords(builder *flatbuffers.Builder, words flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(6, flatbuffers.UOffsetT(words), 0)
}
func MoveRecordStartWordsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func MoveRecordAddCount(builder *flatbuffers.Builder, count int32) {
	builder.PrependInt32Slot(7, count, 0)
}
func MoveRecordAddScore(builder *flatbuffers.Builder, score int32) {
	builder.PrependInt32Slot(8, score, 0)
}
func MoveRecordAddTotal(builder *flatbuffers.Builder, total int32) {
	builder.PrependInt32Slot(9, total, 0)
}
func MoveRecordEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
