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

package scrabblefb

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

type Ack struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *Ack) MutateOk(n bool) bool {
	return rcv._tab.MutateBoolSlot(4, n)
}

func AckStart(builder *flatbuffers.Builder) {
	builder.StartObject(1)
}
func AckAddOk(builder *flatbuffers.Builder, ok bool) {
	builder.PrependBoolSlot(0, ok, false)
}
func AckEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
