当前位置: 首页>>代码示例>>Python>>正文


Python StreamReader.hash方法代码示例

本文整理汇总了Python中s3py.io.StreamReader.hash方法的典型用法代码示例。如果您正苦于以下问题:Python StreamReader.hash方法的具体用法?Python StreamReader.hash怎么用?Python StreamReader.hash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在s3py.io.StreamReader的用法示例。


在下文中一共展示了StreamReader.hash方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import hash [as 别名]
 def read_rcol(self, stream, rcol):
     self.read_tag(stream)
     s = StreamReader(stream)
     self.version = s.u32()
     name = s.hash(self.NAMES)
     value = rcol.get_block(s.u32(),(MaterialDefinition, MaterialSet))
     self.default_material = self.Element(name, value)
     self.elements = []
     cItems = s.u32()
     for i in range(cItems):
         value = rcol.get_block(s.u32(), (MaterialDefinition, MaterialSet))
         name = s.hash(self.NAMES)
         self.elements.append(self.Element(name, value))
开发者ID:markmanching,项目名称:s3py,代码行数:15,代码来源:material.py

示例2: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import hash [as 别名]
    def read(self, stream, resources=None):
        s = StreamReader(stream)
        s.version = s.u32()
        tgi = TGIList(package=resources)
        tgi.begin_read(stream)
        self.components = [s.hash(self.component_hashes) for i in range(s.i8())]
        self.component_data = {}

        def read_component_data():
            key = s.p32()
            val = None
            t = s.i8()
            if t == 0x00:
                val = t, s.p32()
            elif t == 0x01:
                val = t, tgi.get_resource(s.i32())
            elif t == 0x02:
                val = t, tgi.get_resource(s.i32())
            elif t == 0x03:
                val = t, s.p32()
            elif t == 0x04:
                val = t, s.u32()
            self.component_data[key] = val

        for i in range(s.i8()):
            read_component_data()
        self.visible = s.u8()
        tgi.end_read(stream)
        pass
开发者ID:markmanching,项目名称:s3py,代码行数:31,代码来源:__init__.py

示例3: read_rcol

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import hash [as 别名]
 def read_rcol(self, stream, rcol):
     s = StreamReader(stream)
     self.version = s.u32()
     self.deltas = {}
     c = s.i32()
     for i in range(c):
         hsh = s.hash()
         self.deltas[hsh] = self.Delta(stream)
     pass
开发者ID:markmanching,项目名称:s3py,代码行数:11,代码来源:rig.py

示例4: read

# 需要导入模块: from s3py.io import StreamReader [as 别名]
# 或者: from s3py.io.StreamReader import hash [as 别名]
 def read(self, stream, resources=None):
     s = StreamReader(stream)
     self.version = s.u32()
     tgi = TGIList()
     tgi.begin_read(stream)
     self.presets = ProductBase.read_presets(stream,tgi)
     if self.version >= 0x00000016:
         self.instance_name = s.s7(size=16,order='>')
     self.product_info = ProductInfo()
     self.product_info.read(stream,tgi)
     self.object_component = tgi.get_resource(s.i32())
     self.object_type_flags = s.u32()
     if self.version >= 0x00000001A:
         self.object_type_flags_2 = s.u32()
     self.wall_placement_flags = s.u32()
     self.movement_flags = s.u32()
     self.num_wall_cutout_tiles_per_level = s.i32()
     self.num_levels = s.i32()
     self.wall_masks = [self.WallMaskEntry(stream,tgi) for i in range(s.i8())]
     self.script_enabled = s.i8() == 1
     self.diagonal_object = tgi.get_resource(s.i32())
     self.ambiance_type = s.hash()
     self.room_flags = s.u32()
     self.function_category_flags = s.u32()
     self.sub_category_flags = s.u64()
     if self.version >= 0x0000001C:
         self.sub_category_flags_2 = s.u64()
     self.sub_room_flags = s.u64()
     self.build_category_flags = s.u32()
     self.wall_cutout_texture = tgi.get_resource(s.i32())
     if self.version >= 0x00000017:
         self.floor_cutout_texture = tgi.get_resource(s.i32())
         self.floor_cutout_level_offset = s.i32()
         self.floor_cutout_bounds_length = s.f32()
     if self.version >= 0x00000020:
         self.floor_cutout_bounds_width = s.f32()
     if self.version >= 0x0000021:
         self.floor_cutout_offset_x = s.f32()
         self.floor_cutout_offset_z = s.f32()
     if self.version >= 0x00000018:
         self.shell_states = [s.hash() for i in range(s.i32())]
     if self.version >= 0x00000019:
         self.shell_level_below =tgi.get_resource(s.i32())
     if self.version >= 0x0000001B:
         self.shell_proxy =tgi.get_resource(s.i32())
     if self.version >= 0x0000001D:
         self.blueprint_xml =tgi.get_resource(s.i32())
     if self.version >= 0x0000001E:
         self.blueprint_icon =tgi.get_resource(s.i32())
     if self.version >= 0x0000001F:
         self.blueprint_icon_offset_min_x = s.f32()
         self.blueprint_icon_offset_min_z = s.f32()
         self.blueprint_icon_offset_max_x = s.f32()
         self.blueprint_icon_offset_max_z = s.f32()
     self.slot_placement_flags = s.u32()
     self.surface_type = s.s7(size=16,order='>')
     self.source_material = s.s7(size=16,order='>')
     self.moodlet_given = s.u32()
     self.moodlet_score = s.u32()
     assert s.u32() == 5
     self.ratings = [self.ProductRating(stream) for i in range(5)]
     self.fallback = tgi.get_resource(s.i32())
     if self.version >= 0x00000022:
         self.modular_arch_end_east_model = tgi.get_resource(s.i32())
         self.modular_arch_end_west_model = tgi.get_resource(s.i32())
         self.modular_arch_connecting_model = tgi.get_resource(s.i32())
         self.modular_arch_single_model = tgi.get_resource(s.i32())
     tgi.end_read(stream)
开发者ID:markmanching,项目名称:s3py,代码行数:70,代码来源:catalog.py


注:本文中的s3py.io.StreamReader.hash方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。