Beispiel #1
0
from skadi import enum
from skadi.io import unpacker

try:
    from skadi.io.unpacker import cProp as pu
except ImportError:
    from skadi.io.unpacker import prop as pu

PVS = enum(Leaving=1, Entering=2, Deleting=4)


def construct(*args):
    return Unpacker(*args)


class Unpacker(unpacker.Unpacker):
    def __init__(self, bitstream, base_index, count, delta, class_bits, world):
        super(Unpacker, self).__init__(bitstream)
        self.base_index = base_index
        self.count = count
        self.is_delta = delta
        self.class_bits = class_bits
        self.world = world
        self._index = -1
        self._entities_read = 0

    def unpack(self):
        if self._entities_read == self.count:
            if not self.is_delta:
                raise unpacker.UnpackComplete()
            try:
Beispiel #2
0
from skadi import enum

Flag = enum(Unsigned=1 << 0,
            Coord=1 << 1,
            NoScale=1 << 2,
            RoundDown=1 << 3,
            RoundUp=1 << 4,
            Normal=1 << 5,
            Exclude=1 << 6,
            XYZE=1 << 7,
            InsideArray=1 << 8,
            ProxyAlways=1 << 9,
            VectorElem=1 << 10,
            Collapsible=1 << 11,
            CoordMP=1 << 12,
            CoordMPLowPrecision=1 << 13,
            CoordMPIntegral=1 << 14,
            CellCoord=1 << 15,
            CellCoordLowPrecision=1 << 16,
            CellCoordIntegral=1 << 17,
            ChangesOften=1 << 18,
            EncodedAgainstTickcount=1 << 19)

Type = enum(Int=0,
            Float=1,
            Vector=2,
            VectorXY=3,
            String=4,
            Array=5,
            DataTable=6,
            Int64=7)
Beispiel #3
0
from skadi import enum

Flag = enum(
  Unsigned              = 1 <<  0, Coord                   = 1 <<  1,
  NoScale               = 1 <<  2, RoundDown               = 1 <<  3,
  RoundUp               = 1 <<  4, Normal                  = 1 <<  5,
  Exclude               = 1 <<  6, XYZE                    = 1 <<  7,
  InsideArray           = 1 <<  8, ProxyAlways             = 1 <<  9,
  VectorElem            = 1 << 10, Collapsible             = 1 << 11,
  CoordMP               = 1 << 12, CoordMPLowPrecision     = 1 << 13,
  CoordMPIntegral       = 1 << 14, CellCoord               = 1 << 15,
  CellCoordLowPrecision = 1 << 16, CellCoordIntegral       = 1 << 17,
  ChangesOften          = 1 << 18, EncodedAgainstTickcount = 1 << 19
)

Type = enum(
  Int       = 0, Float  = 1, Vector = 2,
  VectorXY  = 3, String = 4, Array  = 5,
  DataTable = 6, Int64  = 7
)
Beispiel #4
0
from skadi import enum
from skadi.io import unpacker

try:
  from skadi.io.unpacker import cProp as pu
except ImportError:
  from skadi.io.unpacker import prop as pu


PVS = enum(Leaving=1, Entering=2, Deleting=4)


def construct(*args):
  return Unpacker(*args)


class Unpacker(unpacker.Unpacker):
  def __init__(self, bitstream, base_index, count, delta, class_bits, world):
    super(Unpacker, self).__init__(bitstream)
    self.base_index = base_index
    self.count = count
    self.is_delta = delta
    self.class_bits = class_bits
    self.world = world
    self._index = -1
    self._entities_read = 0

  def unpack(self):
    if self._entities_read == self.count:
      if not self.is_delta:
        raise unpacker.UnpackComplete()