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

package order

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

type CommandShipGroupUpgrade struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *CommandShipGroupUpgrade) Tech() ShipGroupUpgradeTech {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return ShipGroupUpgradeTech(rcv._tab.GetInt8(o + rcv._tab.Pos))
	}
	return 0
}

func (rcv *CommandShipGroupUpgrade) MutateTech(n ShipGroupUpgradeTech) bool {
	return rcv._tab.MutateInt8Slot(6, int8(n))
}

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

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

func CommandShipGroupUpgradeStart(builder *flatbuffers.Builder) {
	builder.StartObject(3)
}
func CommandShipGroupUpgradeAddId(builder *flatbuffers.Builder, id flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(id), 0)
}
func CommandShipGroupUpgradeAddTech(builder *flatbuffers.Builder, tech ShipGroupUpgradeTech) {
	builder.PrependInt8Slot(1, int8(tech), 0)
}
func CommandShipGroupUpgradeAddLevel(builder *flatbuffers.Builder, level float64) {
	builder.PrependFloat64Slot(2, level, 0.0)
}
func CommandShipGroupUpgradeEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
