Files
BA-AD/baad/FlatData/Motion.py
Deathemonic 2386ae982d fix: importing
- typo fix at main
- added __all__ at flatdata init
- added missing type hints
- fix formatting
- table service now uses pathlib
- set unused progress to a private variable
- added proper error handling when extracting (probaly need to refactor it)
- fix path not recognizing as path at table extractor
- change the extracting progress bar to one instead of the download like progress bar
2024-07-14 03:50:50 +08:00

78 lines
2.8 KiB
Python

# automatically generated by the FlatBuffers compiler, do not modify
# namespace: FlatData
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Motion(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = Motion()
x.Init(buf, n + offset)
return x
@classmethod
def GetRootAsMotion(cls, buf, offset=0):
"""This method is deprecated. Please switch to GetRootAs."""
return cls.GetRootAs(buf, offset)
# Motion
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Motion
def Name(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
if o != 0:
return self._tab.String(o + self._tab.Pos)
return None
# Motion
def Positions(self, j):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
x = self._tab.Vector(o)
x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
x = self._tab.Indirect(x)
from ..FlatData.Position import Position
obj = Position()
obj.Init(self._tab.Bytes, x)
return obj
return None
# Motion
def PositionsLength(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
if o != 0:
return self._tab.VectorLen(o)
return 0
# Motion
def PositionsIsNone(self):
o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
return o == 0
def Start(builder): builder.StartObject(2)
def MotionStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder)
def AddName(builder, Name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(Name), 0)
def MotionAddName(builder, Name):
"""This method is deprecated. Please switch to AddName."""
return AddName(builder, Name)
def AddPositions(builder, Positions): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(Positions), 0)
def MotionAddPositions(builder, Positions):
"""This method is deprecated. Please switch to AddPositions."""
return AddPositions(builder, Positions)
def StartPositionsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def MotionStartPositionsVector(builder, numElems):
"""This method is deprecated. Please switch to Start."""
return StartPositionsVector(builder, numElems)
def End(builder): return builder.EndObject()
def MotionEnd(builder):
"""This method is deprecated. Please switch to End."""
return End(builder)