Exemplo n.º 1
0
def read_sound_shape_common(file):
    sound_shape = SoundShape()
    sound_shape.key = string(file)
    sound_shape.type = string(file)
    points = int4(file)
    sound_shape.points = []
    for j in range(points):
        point = Point3D(float4(file), float4(file), float4(file))
        sound_shape.points.append(point)
    sound_shape.inner_radius = float4(file)
    sound_shape.outer_radius = float4(file)
    sound_shape.inner_cube = Cube(float4(file), float4(file), float4(file),
                                  float4(file), float4(file), float4(file))
    sound_shape.outer_cube = Cube(float4(file), float4(file), float4(file),
                                  float4(file), float4(file), float4(file))
    river_nodes_amount = int4(file)
    sound_shape.river_nodes = []
    for i in range(river_nodes_amount):
        river_node_version = int2(file)
        sound_shape.river_nodes.append(
            river_node_versions.get_reader(river_node_version)(file))
    sound_shape.clamp_to_surface = bool1(file)
    sound_shape.height_mode = string(file)
    sound_shape.campaign_type_mask = int4(file)

    return sound_shape
Exemplo n.º 2
0
def read_deployment_zone_region(file):
    deployment_zone_region = DeploymentZoneRegion()

    boundary_list_amount = int4(file)
    deployment_zone_region.boundary_list = []
    for i in range(boundary_list_amount):
        boundary_version = int2(file)
        deployment_zone_region.boundary_list.append(read_boundary_list(file))
    deployment_zone_region.orientation = float4(file)
    deployment_zone_region.snap_facing = bool1(file)
    deployment_zone_region.id = int4(file)

    return deployment_zone_region
Exemplo n.º 3
0
def read_custom_material_mesh_v2(file):
    custom_material_mesh = CustomMaterialMesh()
    vertices_amount = int4(file)
    custom_material_mesh.vertices = []
    for i in range(vertices_amount):
        vertex = Point3D(float4(file), float4(file), float4(file))
        custom_material_mesh.vertices.append(vertex)
    indices_amount = int4(file)
    custom_material_mesh.indices = []
    for i in range(indices_amount):
        custom_material_mesh.indices.append(int2(file))
    custom_material_mesh.material = string(file)
    custom_material_mesh.height_mode = string(file)

    return custom_material_mesh
Exemplo n.º 4
0
def read_particle_instance_v5(file):
    particle = read_particle_instnace_common(file)
    particle.pdlc_mask = int4(file)
    particle.autoplay = bool1(file)
    particle.visible_in_shroud = bool1(file)

    return particle
Exemplo n.º 5
0
def read_capture_location_list(file):
    capture_locations = int4(file)
    capture_locations_list = []
    for i in range(capture_locations):
        capture_locations_list.append(read_capture_location(file))

    return capture_locations_list
Exemplo n.º 6
0
def read_prop_instance_v14(file):
    prop = read_prop_instance_common(file)
    strange_number = int4(file)
    bool1(file)
    bool1(file)

    return prop
Exemplo n.º 7
0
def read_capture_location_set(file: BinaryIO):
    version = int2(file)  # version
    capture_locations_lists = int4(file)
    capture_locations_set = []
    for i in range(capture_locations_lists):
        capture_locations_set.append(read_capture_location_list(file))

    return capture_locations_set
Exemplo n.º 8
0
def read_boundary_list(file):
    boundary_list = []
    amount = int4(file)
    for i in range(amount):
        boundary_version = int2(file)
        boundary_list.append(read_boundary(file))

    return boundary_list
def read_prefab_instance_list(file: BinaryIO):
    version = int2(file)  # version
    prefab_amount = int4(file)
    prefab_instance_list = []
    for i in range(prefab_amount):
        prefab_instance_list.append(read_prefab_instance(file))

    return prefab_instance_list
Exemplo n.º 10
0
def read_non_terrain_outlines(file: BinaryIO):
    outlines_amount = int4(file)
    outlines = []
    capture_locations_set = []
    for i in range(outlines_amount):
        outlines.append(read_otline(file))

    return outlines
Exemplo n.º 11
0
def read_point_light_v5(file):
    point_light = read_point_light_common(file)
    point_light.flags = {"lf_relative": bool1(file)}
    point_light.height_mode = string(file)
    point_light.flags["light_probes_only"] = bool1(file)
    point_light.pdlc_mask = int4(file)

    return point_light
Exemplo n.º 12
0
def read_composite_scene_v6(file):
    composite_scene = read_composite_scene_common(file)
    composite_scene.pdlc_mask = int4(file)
    composite_scene.flags = {}
    composite_scene.flags["autoplay"] = bool1(file)
    composite_scene.flags["visible_in_shroud"] = bool1(file)
    composite_scene.flags["no_culling"] = bool1(file)

    return composite_scene
Exemplo n.º 13
0
def read_otline(file):
    point_amount = int4(file)
    outline = Outline()
    outline.points = []
    for i in range(point_amount):
        point = Point2D(float4(file), float4(file))
        outline.points.append(point)

    return outline
Exemplo n.º 14
0
def read_polygone(file):
    polygone = Polygone
    polygone.points_amount = int4(file)
    polygone.points = []
    for i in range(polygone.points_amount):
        point = Point2D(float4(file), float4(file))
        polygone.points.append(point)

    return polygone
Exemplo n.º 15
0
def read_deployment_list(file: BinaryIO):
    version = int2(file)  # version
    amount = int4(file)
    deployment_list = []
    for i in range(amount):
        deployment_area_version = int2(file)
        deployment_list.append(read_deployment_area(file))

    return deployment_list
Exemplo n.º 16
0
def read_ai_hints(file: BinaryIO):
    version = int2(file)  # version
    # print('Version: ', version)
    ai_hints = AiHint()

    ai_hints.separators = []

    # separators
    separators_version = int2(file)
    separators_amount = int4(file)
    for i in range(separators_amount):
        ai_hints.separators.append(read_polyline(file))

    # directed_points
    directed_points_version = int2(file)
    directed_points_amount = int4(file)

    # polylines
    polylines_version = int2(file)
    polylines_amount = int4(file)

    polylines = []
    ai_hints.polylines = []
    for i in range(polylines_amount):
        ai_hints.polylines.append(read_polyline(file))

    # polylines list

    polylines_list_version = int2(file)
    polylines_list_amount = int4(file)

    ai_hints.polylines_list_list = []
    for i in range(polylines_list_amount):
        poly_lines_list = PolyLineList()

        hint_polylines_version = int2(file)
        poly_lines_list.type = string(file)
        polygons_amount = int4(file)
        poly_lines_list.polygons = []
        for j in range(polygons_amount):
            poly_lines_list.polygons.append(read_polygone(file))

    return ai_hints
Exemplo n.º 17
0
def read_point_light_v4(file):
    point_light = read_point_light_common(file)
    # in all files it is in1 -4
    file.read(1)
    point_light.height_mode = string(file)
    # in all files it is 0
    file.read(1)
    point_light.pdlc_mask = int4(file)

    return point_light
Exemplo n.º 18
0
def read_boundary(file):
    boundary = Boundary()
    boundary.type = string(file)
    positions = int4(file)
    boundary.positions = []
    for i in range(positions):
        position = Point2D(float4(file), float4(file))
        boundary.positions.append(position)

    return boundary
Exemplo n.º 19
0
def read_deployment_area(file):
    deployment_area = DeploymentArea()
    deployment_area.category = string(file)
    deployment_zones_amount = int4(file)
    deployment_area.deployment_zone_regions = []
    for i in range(deployment_zones_amount):
        deployment_zone_region_version = int2(file)
        deployment_area.deployment_zone_regions.append(read_deployment_zone_region(file))

    return deployment_area
Exemplo n.º 20
0
def read_bmd_catchment_area_list(file: BinaryIO):
    version = int2(file)  # version
    amount = int4(file)
    for i in range(amount):
        bmd_catchment_area_version = int2(file)
        bmd_catchment_area_name = string(file)
        some_floats = (float4(file), float4(file), float4(file), float4(file))
        file.read(10)
        # print(bmd_catchment_area_version, bmd_catchment_area_name, some_floats)
    # assert int4(file) == 0, "BMD_CATCHMENT_AREA_LIST has items"
Exemplo n.º 21
0
def read_terrain_stencil_triangle_list(file: BinaryIO):
    version = int2(file)  # version
    amount = int4(file)
    terrain_stencil_triangle_list = []
    for i in range(amount):
        terrain_stencil_triangle_version = int2(file)
        terrain_stencil_triangle_list.append(
            read_terrain_stencil_triangle(file))

    return terrain_stencil_triangle_list
Exemplo n.º 22
0
def read_building_projectile_emitter_v2(file):
    building_projectile_emitter = BuildingProjectileEmitter()
    building_projectile_emitter.position = Point3D(float4(file), float4(file),
                                                   float4(file))
    building_projectile_emitter.direction = (float4(file), float4(file),
                                             float4(file))
    # print(building_projectile_emitter.direction)
    building_projectile_emitter.building_index = int4(file)
    building_projectile_emitter.height_mode = string(file)

    return building_projectile_emitter
Exemplo n.º 23
0
def read_polyline(file):
    polyline = PolyLine
    version = int2(file)
    polyline.type = string(file)
    points_amount = int4(file)
    polyline.points = []
    for i in range(points_amount):
        point = Point2D(float4(file), float4(file))
        polyline.points.append(point)

    return polyline
Exemplo n.º 24
0
def read_capture_location(file):
    capture_location = CaptureLocation()
    capture_location.location = (float4(file), float4(file))
    capture_location.radius = float4(file)
    capture_location.valid_for_min_num_players = int4(file)
    capture_location.valid_for_max_num_players = int4(file)
    capture_location.capture_point_type = string(file)
    location_points = int4(file)
    capture_location.location_points_list = []
    for l in range(location_points):
        point = Point2D(float4(file), float4(file))
        capture_location.location_points_list.append(point)
    capture_location.database_key = string(file)
    capture_location.flag_facing = (float4(file), float4(file))
    building_links_amount = int4(file)
    capture_location.building_links = []
    for l in range(building_links_amount):
        building_link = CaptureLocationBuildingLink()
        building_link.version = int2(file)
        building_link.building_index = int4(file)
        building_link.prefab_index = int4(file)
        building_link.link = string(file)
        capture_location.building_links.append(building_link)

    return capture_location
Exemplo n.º 25
0
def read_zone_template(file):
    zone_template = ZoneTemplate()
    points_amount = int4(file)
    outline = Outline()
    for i in range(points_amount):
        outline.points.append(Point2D(float4(file), float4(file)))
    zone_template.outline = outline
    # <zone_name> <entity_formation_template name=''> and <lines/>
    file.read(8)
    # transformation matrix
    zone_template.transformation = read_transform_n_x_m(file, 4, 4)

    return zone_template
Exemplo n.º 26
0
def read_prefab_instance(file):
    prefab_instance = PrefabInstance()
    prefab_version = int2(file)
    prefab_instance.name = string(file)
    prefab_instance.transformation = read_transform_n_x_m(file, 4, 4)
    # print(prefab_instance.transform)
    property_overrides = int4(file)
    # print('Property overrides: ', property_overrides)
    for j in range(property_overrides):
        file.read(2)
        property_value = string(file)
        # print(property_value)
        file.read(14)
    file.read(7)
    prefab_instance.height_mode = string(file)

    return prefab_instance
Exemplo n.º 27
0
def read_bmd_outline_list(file: BinaryIO):
    version = int2(file)  # version
    # print(version)
    assert int4(file) == 0, "BMD_OUTLINE_LIST has items"
Exemplo n.º 28
0
def read_sound_shape_v6(file):
    sound_shape = read_sound_shape_common(file)
    sound_shape.pdlc_mask = int4(file)

    return sound_shape
Exemplo n.º 29
0
def read_camera_zones(file: BinaryIO):
    int2(file)  # version
    assert int4(file) == 0, "CAMERA_ZONES has items"
Exemplo n.º 30
0
def read_terrain_outlines(file: BinaryIO):
    assert int4(file) == 0, "TERRAIN_OUTLINES has items"