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

package scrabblefb

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

type LinkResult struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func LinkResultStart(builder *flatbuffers.Builder) {
	builder.StartObject(6)
}
func LinkResultAddStatus(builder *flatbuffers.Builder, status flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(status), 0)
}
func LinkResultAddSecondaryUserId(builder *flatbuffers.Builder, secondaryUserId flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(secondaryUserId), 0)
}
func LinkResultAddSecondaryDisplayName(builder *flatbuffers.Builder, secondaryDisplayName flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(secondaryDisplayName), 0)
}
func LinkResultAddSecondaryGames(builder *flatbuffers.Builder, secondaryGames int32) {
	builder.PrependInt32Slot(3, secondaryGames, 0)
}
func LinkResultAddSecondaryFriends(builder *flatbuffers.Builder, secondaryFriends int32) {
	builder.PrependInt32Slot(4, secondaryFriends, 0)
}
func LinkResultAddSession(builder *flatbuffers.Builder, session flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(5, flatbuffers.UOffsetT(session), 0)
}
func LinkResultEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
