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

package order

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

type CommandPlanetRouteSet struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

func (rcv *CommandPlanetRouteSet) Origin() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *CommandPlanetRouteSet) MutateOrigin(n int64) bool {
	return rcv._tab.MutateInt64Slot(4, n)
}

func (rcv *CommandPlanetRouteSet) Destination() int64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetInt64(o + rcv._tab.Pos)
	}
	return 0
}

func (rcv *CommandPlanetRouteSet) MutateDestination(n int64) bool {
	return rcv._tab.MutateInt64Slot(6, n)
}

func (rcv *CommandPlanetRouteSet) LoadType() PlanetRouteLoadType {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return PlanetRouteLoadType(rcv._tab.GetInt8(o + rcv._tab.Pos))
	}
	return 0
}

func (rcv *CommandPlanetRouteSet) MutateLoadType(n PlanetRouteLoadType) bool {
	return rcv._tab.MutateInt8Slot(8, int8(n))
}

func CommandPlanetRouteSetStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func CommandPlanetRouteSetAddOrigin(builder *flatbuffers.Builder, origin int64) {
	builder.PrependInt64Slot(0, origin, 0)
}
func CommandPlanetRouteSetAddDestination(builder *flatbuffers.Builder, destination int64) {
	builder.PrependInt64Slot(1, destination, 0)
}
func CommandPlanetRouteSetAddLoadType(builder *flatbuffers.Builder, loadType PlanetRouteLoadType) {
	builder.PrependInt8Slot(2, int8(loadType), 0)
}
func CommandPlanetRouteSetEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
