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

package order

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

type CommandPlanetProduce struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

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

func (rcv *CommandPlanetProduce) Production() PlanetProduction {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return PlanetProduction(rcv._tab.GetInt8(o + rcv._tab.Pos))
	}
	return 0
}

func (rcv *CommandPlanetProduce) MutateProduction(n PlanetProduction) bool {
	return rcv._tab.MutateInt8Slot(6, int8(n))
}

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

func CommandPlanetProduceStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func CommandPlanetProduceAddNumber(builder *flatbuffers.Builder, number int64) {
	builder.PrependInt64Slot(0, number, 0)
}
func CommandPlanetProduceAddProduction(builder *flatbuffers.Builder, production PlanetProduction) {
	builder.PrependInt8Slot(1, int8(production), 0)
}
func CommandPlanetProduceAddSubject(builder *flatbuffers.Builder, subject flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(2, flatbuffers.UOffsetT(subject), 0)
}
func CommandPlanetProduceEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
