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

package fbast

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

type FloatLiteral struct {
	_tab flatbuffers.Table
}

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

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

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

func (rcv *FloatLiteral) BaseNode(obj *BaseNode) *BaseNode {
	o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
	if o != 0 {
		x := rcv._tab.Indirect(o + rcv._tab.Pos)
		if obj == nil {
			obj = new(BaseNode)
		}
		obj.Init(rcv._tab.Bytes, x)
		return obj
	}
	return nil
}

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

func (rcv *FloatLiteral) MutateValue(n float64) bool {
	return rcv._tab.MutateFloat64Slot(6, n)
}

func FloatLiteralStart(builder *flatbuffers.Builder) {
	builder.StartObject(2)
}
func FloatLiteralAddBaseNode(builder *flatbuffers.Builder, baseNode flatbuffers.UOffsetT) {
	builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(baseNode), 0)
}
func FloatLiteralAddValue(builder *flatbuffers.Builder, value float64) {
	builder.PrependFloat64Slot(1, value, 0.0)
}
func FloatLiteralEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
	return builder.EndObject()
}
