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

package scrabblefb

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

type BlockStatus struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *BlockStatus) MutateBlocked(n bool) bool {
	return rcv._tab.MutateBoolSlot(4, n)
}

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

func (rcv *BlockStatus) MutatePermanent(n bool) bool {
	return rcv._tab.MutateBoolSlot(6, n)
}

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

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

func BlockStatusStart(builder *flatbuffers.Builder) {
	builder.StartObject(4)
}
func BlockStatusAddBlocked(builder *flatbuffers.Builder, blocked bool) {
	builder.PrependBoolSlot(0, blocked, false)
}
func BlockStatusAddPermanent(builder *flatbuffers.Builder, permanent bool) {
	builder.PrependBoolSlot(1, permanent, false)
}
func BlockStatusAddUntil(builder *flatbuffers.Builder, until flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(until), 0)
}
func BlockStatusAddReason(builder *flatbuffers.Builder, reason flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(3, flatbuffers.UOffsetT(reason), 0)
}
func BlockStatusEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
