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

package order

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

type CommandShipGroupLoad struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *CommandShipGroupLoad) Cargo() ShipGroupCargo {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return ShipGroupCargo(rcv._tab.GetInt8(o + rcv._tab.Pos))
	}
	return 0
}

func (rcv *CommandShipGroupLoad) MutateCargo(n ShipGroupCargo) bool {
	return rcv._tab.MutateInt8Slot(6, int8(n))
}

func (rcv *CommandShipGroupLoad) Quantity() float64 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
	if o != 0 {
		return rcv._tab.GetFloat64(o + rcv._tab.Pos)
	}
	return 0.0
}

func (rcv *CommandShipGroupLoad) MutateQuantity(n float64) bool {
	return rcv._tab.MutateFloat64Slot(8, n)
}

func CommandShipGroupLoadStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func CommandShipGroupLoadAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0)
}
func CommandShipGroupLoadAddCargo(builder *flatbuffers.Builder, cargo ShipGroupCargo) {
	builder.PrependInt8Slot(1, int8(cargo), 0)
}
func CommandShipGroupLoadAddQuantity(builder *flatbuffers.Builder, quantity float64) {
	builder.PrependFloat64Slot(2, quantity, 0.0)
}
func CommandShipGroupLoadEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
