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

package scrabblefb

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

type FeedbackState struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *FeedbackState) MutateCanSend(n bool) bool {
	return rcv._tab.MutateBoolSlot(4, n)
}

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

func (rcv *FeedbackState) Reply(obj *FeedbackReply) *FeedbackReply {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(FeedbackReply)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

func FeedbackStateStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func FeedbackStateAddCanSend(builder *flatbuffers.Builder, canSend bool) {
	builder.PrependBoolSlot(0, canSend, false)
}
func FeedbackStateAddBlockedReason(builder *flatbuffers.Builder, blockedReason flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(blockedReason), 0)
}
func FeedbackStateAddReply(builder *flatbuffers.Builder, reply flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(reply), 0)
}
func FeedbackStateEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
