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

package scrabblefb

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

type Wallet struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

func (rcv *Wallet) Segments(obj *WalletSegment, j int) bool {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	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 *Wallet) SegmentsLength() int {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.VectorLen(o)
	}
	return 0
}

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

func (rcv *Wallet) MutateAdsForever(n bool) bool {
	return rcv._tab.MutateBoolSlot(6, n)
}

func (rcv *Wallet) AdsPaidUntilMs() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *Wallet) MutateAdsPaidUntilMs(n int64) bool {
	return rcv._tab.MutateInt64Slot(8, n)
}

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

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

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

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

func WalletStart(builder *flatbuffers.Builder) {
	builder.StartObject(5)
}
func WalletAddSegments(builder *flatbuffers.Builder, segments flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(segments), 0)
}
func WalletStartSegmentsVector(builder *flatbuffers.Builder, numElems int) flatbuffers.UOffsetT {
	return builder.StartVector(4, numElems, 4)
}
func WalletAddAdsForever(builder *flatbuffers.Builder, adsForever bool) {
	builder.PrependBoolSlot(1, adsForever, false)
}
func WalletAddAdsPaidUntilMs(builder *flatbuffers.Builder, adsPaidUntilMs int64) {
	builder.PrependInt64Slot(2, adsPaidUntilMs, 0)
}
func WalletAddHints(builder *flatbuffers.Builder, hints int32) {
	builder.PrependInt32Slot(3, hints, 0)
}
func WalletAddRewardChips(builder *flatbuffers.Builder, rewardChips int32) {
	builder.PrependInt32Slot(4, rewardChips, 0)
}
func WalletEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
