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

package scrabblefb

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

type GameLimits struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

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

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

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

func (rcv *GameLimits) Friends() int32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetInt32(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *GameLimits) MutateFriends(n int32) bool {
	return rcv._tab.MutateInt32Slot(8, n)
}

func GameLimitsStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func GameLimitsAddVsAi(builder *flatbuffers.Builder, vsAi int32) {
	builder.PrependInt32Slot(0, vsAi, 0)
}
func GameLimitsAddRandom(builder *flatbuffers.Builder, random int32) {
	builder.PrependInt32Slot(1, random, 0)
}
func GameLimitsAddFriends(builder *flatbuffers.Builder, friends int32) {
	builder.PrependInt32Slot(2, friends, 0)
}
func GameLimitsEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
