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

package battle

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

type TechEntry struct {
	_tab flatbuffers.Table
}

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

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

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

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

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

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

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

func (rcv *TechEntry) Value() float32 {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
	if o != 0 {
		return rcv._tab.GetFloat32(o + rcv._tab.Pos)
	}
	return 0.0
}

func (rcv *TechEntry) MutateValue(n float32) bool {
	return rcv._tab.MutateFloat32Slot(6, n)
}

func TechEntryStart(builder *flatbuffers.Builder) {
	builder.StartObject(2)
}
func TechEntryAddKey(builder *flatbuffers.Builder, key flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(key), 0)
}
func TechEntryAddValue(builder *flatbuffers.Builder, value float32) {
	builder.PrependFloat32Slot(1, value, 0.0)
}
func TechEntryEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
