def _generic_placeobject_parser(self, obj, version):
        """A generic parser for several PlaceObjectX."""
        bc = BitConsumer(self._src)
        obj.PlaceFlagHasClipActions = bc.u_get(1)
        obj.PlaceFlagHasClipDepth = bc.u_get(1)
        obj.PlaceFlagHasName = bc.u_get(1)
        obj.PlaceFlagHasRatio = bc.u_get(1)
        obj.PlaceFlagHasColorTransform = bc.u_get(1)
        obj.PlaceFlagHasMatrix = bc.u_get(1)
        obj.PlaceFlagHasCharacter = bc.u_get(1)
        obj.PlaceFlagMove = bc.u_get(1)

        if version == 3:
            obj.Reserved = bc.u_get(1)
            obj.PlaceFlagOpaqueBackground = bc.u_get(1)
            obj.PlaceFlagHasVisible = bc.u_get(1)
            obj.PlaceFlagHasImage = bc.u_get(1)
            obj.PlaceFlagHasClassName = bc.u_get(1)
            obj.PlaceFlagHasCacheAsBitmap = bc.u_get(1)
            obj.PlaceFlagHasBlendMode = bc.u_get(1)
            obj.PlaceFlagHasFilterList = bc.u_get(1)

        obj.Depth = unpack_ui16(self._src)

        if version == 3:
            if obj.PlaceFlagHasClassName or (
                    obj.PlaceFlagHasImage and obj.PlaceFlagHasCharacter):
                obj.ClassName = self._get_struct_string()

        if obj.PlaceFlagHasCharacter:
            obj.CharacterId = unpack_ui16(self._src)
        if obj.PlaceFlagHasMatrix:
            obj.Matrix = self._get_struct_matrix()
        if obj.PlaceFlagHasColorTransform:
            obj.ColorTransform = self._get_struct_cxformwithalpha()
        if obj.PlaceFlagHasRatio:
            obj.Ratio = unpack_ui16(self._src)
        if obj.PlaceFlagHasName:
            obj.Name = self._get_struct_string()
        if obj.PlaceFlagHasClipDepth:
            obj.ClipDepth = unpack_ui16(self._src)

        if version == 3:
            if obj.PlaceFlagHasFilterList:
                obj.SurfaceFilterList = self._get_struct_filterlist()
            if obj.PlaceFlagHasBlendMode:
                obj.BlendMode = unpack_ui8(self._src)
            if obj.PlaceFlagHasCacheAsBitmap:
                obj.BitmapCache = unpack_ui8(self._src)
            if obj.PlaceFlagHasVisible:
                obj.Visible = unpack_ui8(self._src)
                obj.BackgroundColor = self._get_struct_rgba()

        if obj.PlaceFlagHasClipActions:
            obj.ClipActions = self._get_struct_clipactions()
def _generic_placeobject_parser ( self , obj , version ) : bc = BitConsumer ( self . _src ) obj . PlaceFlagHasClipActions = bc . u_get ( 1 ) obj . PlaceFlagHasClipDepth = bc . u_get ( 1 ) obj . PlaceFlagHasName = bc . u_get ( 1 ) obj . PlaceFlagHasRatio = bc . u_get ( 1 ) obj . PlaceFlagHasColorTransform = bc . u_get ( 1 ) obj . PlaceFlagHasMatrix = bc . u_get ( 1 ) obj . PlaceFlagHasCharacter = bc . u_get ( 1 ) obj . PlaceFlagMove = bc . u_get ( 1 ) if version == 3 : obj . Reserved = bc . u_get ( 1 ) obj . PlaceFlagOpaqueBackground = bc . u_get ( 1 ) obj . PlaceFlagHasVisible = bc . u_get ( 1 ) obj . PlaceFlagHasImage = bc . u_get ( 1 ) obj . PlaceFlagHasClassName = bc . u_get ( 1 ) obj . PlaceFlagHasCacheAsBitmap = bc . u_get ( 1 ) obj . PlaceFlagHasBlendMode = bc . u_get ( 1 ) obj . PlaceFlagHasFilterList = bc . u_get ( 1 ) obj . Depth = unpack_ui16 ( self . _src ) if version == 3 : if obj . PlaceFlagHasClassName or ( obj . PlaceFlagHasImage and obj . PlaceFlagHasCharacter ) : obj . ClassName = self . _get_struct_string ( ) if obj . PlaceFlagHasCharacter : obj . CharacterId = unpack_ui16 ( self . _src ) if obj . PlaceFlagHasMatrix : obj . Matrix = self . _get_struct_matrix ( ) if obj . PlaceFlagHasColorTransform : obj . ColorTransform = self . _get_struct_cxformwithalpha ( ) if obj . PlaceFlagHasRatio : obj . Ratio = unpack_ui16 ( self . _src ) if obj . PlaceFlagHasName : obj . Name = self . _get_struct_string ( ) if obj . PlaceFlagHasClipDepth : obj . ClipDepth = unpack_ui16 ( self . _src ) if version == 3 : if obj . PlaceFlagHasFilterList : obj . SurfaceFilterList = self . _get_struct_filterlist ( ) if obj . PlaceFlagHasBlendMode : obj . BlendMode = unpack_ui8 ( self . _src ) if obj . PlaceFlagHasCacheAsBitmap : obj . BitmapCache = unpack_ui8 ( self . _src ) if obj . PlaceFlagHasVisible : obj . Visible = unpack_ui8 ( self . _src ) obj . BackgroundColor = self . _get_struct_rgba ( ) if obj . PlaceFlagHasClipActions : obj . ClipActions = self . _get_struct_clipactions ( )
A generic parser for several PlaceObjectX.