flatbuffers & transcoders
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
// Code generated by the FlatBuffers compiler. DO NOT EDIT.
|
||||
|
||||
package report
|
||||
|
||||
import (
|
||||
flatbuffers "github.com/google/flatbuffers/go"
|
||||
)
|
||||
|
||||
type ShipProduction struct {
|
||||
_tab flatbuffers.Table
|
||||
}
|
||||
|
||||
func GetRootAsShipProduction(buf []byte, offset flatbuffers.UOffsetT) *ShipProduction {
|
||||
n := flatbuffers.GetUOffsetT(buf[offset:])
|
||||
x := &ShipProduction{}
|
||||
x.Init(buf, n+offset)
|
||||
return x
|
||||
}
|
||||
|
||||
func FinishShipProductionBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
|
||||
builder.Finish(offset)
|
||||
}
|
||||
|
||||
func GetSizePrefixedRootAsShipProduction(buf []byte, offset flatbuffers.UOffsetT) *ShipProduction {
|
||||
n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:])
|
||||
x := &ShipProduction{}
|
||||
x.Init(buf, n+offset+flatbuffers.SizeUint32)
|
||||
return x
|
||||
}
|
||||
|
||||
func FinishSizePrefixedShipProductionBuffer(builder *flatbuffers.Builder, offset flatbuffers.UOffsetT) {
|
||||
builder.FinishSizePrefixed(offset)
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Init(buf []byte, i flatbuffers.UOffsetT) {
|
||||
rcv._tab.Bytes = buf
|
||||
rcv._tab.Pos = i
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Table() flatbuffers.Table {
|
||||
return rcv._tab
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Planet() uint64 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(4))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetUint64(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) MutatePlanet(n uint64) bool {
|
||||
return rcv._tab.MutateUint64Slot(4, n)
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Class() []byte {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(6))
|
||||
if o != 0 {
|
||||
return rcv._tab.ByteVector(o + rcv._tab.Pos)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Cost() float32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(8))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) MutateCost(n float32) bool {
|
||||
return rcv._tab.MutateFloat32Slot(8, n)
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) ProdUsed() float32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(10))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) MutateProdUsed(n float32) bool {
|
||||
return rcv._tab.MutateFloat32Slot(10, n)
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Percent() float32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(12))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) MutatePercent(n float32) bool {
|
||||
return rcv._tab.MutateFloat32Slot(12, n)
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) Free() float32 {
|
||||
o := flatbuffers.UOffsetT(rcv._tab.Offset(14))
|
||||
if o != 0 {
|
||||
return rcv._tab.GetFloat32(o + rcv._tab.Pos)
|
||||
}
|
||||
return 0.0
|
||||
}
|
||||
|
||||
func (rcv *ShipProduction) MutateFree(n float32) bool {
|
||||
return rcv._tab.MutateFloat32Slot(14, n)
|
||||
}
|
||||
|
||||
func ShipProductionStart(builder *flatbuffers.Builder) {
|
||||
builder.StartObject(6)
|
||||
}
|
||||
func ShipProductionAddPlanet(builder *flatbuffers.Builder, planet uint64) {
|
||||
builder.PrependUint64Slot(0, planet, 0)
|
||||
}
|
||||
func ShipProductionAddClass(builder *flatbuffers.Builder, class flatbuffers.UOffsetT) {
|
||||
builder.PrependUOffsetTSlot(1, flatbuffers.UOffsetT(class), 0)
|
||||
}
|
||||
func ShipProductionAddCost(builder *flatbuffers.Builder, cost float32) {
|
||||
builder.PrependFloat32Slot(2, cost, 0.0)
|
||||
}
|
||||
func ShipProductionAddProdUsed(builder *flatbuffers.Builder, prodUsed float32) {
|
||||
builder.PrependFloat32Slot(3, prodUsed, 0.0)
|
||||
}
|
||||
func ShipProductionAddPercent(builder *flatbuffers.Builder, percent float32) {
|
||||
builder.PrependFloat32Slot(4, percent, 0.0)
|
||||
}
|
||||
func ShipProductionAddFree(builder *flatbuffers.Builder, free float32) {
|
||||
builder.PrependFloat32Slot(5, free, 0.0)
|
||||
}
|
||||
func ShipProductionEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT {
|
||||
return builder.EndObject()
|
||||
}
|
||||
Reference in New Issue
Block a user