<commit_before>﻿using HedgeLib.Bases;

namespace HedgeLib.Terrain
{
    public class GensTerrainGroup : GensFileBase
    {
        //Variables/Constants
        public InstanceInfo[] InstanceInfos;
        public string[] TerrainModels;

        //Methods
        protected override void Read(ExtendedBinaryReader reader)
        {
            //Root Node
            uint instanceInfoCount = reader.ReadUInt32();
            uint instanceInfoOffsetsOffset = reader.ReadUInt32();

            uint terrainModelCount = reader.ReadUInt32();
            uint terrainModelOffsetsOffset = reader.ReadUInt32();

            //Instance Infos
            InstanceInfos = new InstanceInfo[instanceInfoCount];
            reader.JumpTo(instanceInfoOffsetsOffset, false);

            for (uint i = 0; i < instanceInfoCount; ++i)
            {
                var instanceInfo = new InstanceInfo();
                uint instanceInfoOffset = reader.ReadUInt32();
                var curPos = reader.BaseStream.Position;
                reader.JumpTo(instanceInfoOffset, false);

                uint fileNameCount = reader.ReadUInt32();
                uint fileNameOffsetsOffset = reader.ReadUInt32();
                uint boundingSphereOffset = reader.ReadUInt32();
                reader.JumpTo(fileNameOffsetsOffset, false);

                //File Names
                instanceInfo.FileNames = new string[fileNameCount];

                for (uint i2 = 0; i2 < fileNameCount; ++i2)
                {
                    uint fileNameOffset = reader.ReadUInt32();
                    reader.JumpTo(fileNameOffset, false);

                    string fileName = reader.ReadNullTerminatedString();
                    instanceInfo.FileNames[i2] = fileName;
                    reader.FixPadding(4);
                }

                //Bounding Sphere
                reader.JumpTo(boundingSphereOffset, false);
                instanceInfo.BoundingSphereCenter = reader.ReadVector3();
                instanceInfo.BoundingSphereRadius = reader.ReadSingle();

                InstanceInfos[i] = instanceInfo;
                reader.BaseStream.Position = curPos;
            }

            //Terrain Models
            TerrainModels = new string[terrainModelCount];
            reader.JumpTo(terrainModelOffsetsOffset, false);

            for (uint i = 0; i < terrainModelCount; ++i)
            {
                uint terrainModelOffset = reader.ReadUInt32();<commit_msg>SCREW. ME.<commit_after>﻿using HedgeLib.Bases;

namespace HedgeLib.Terrain
{
    public class GensTerrainGroup : GensFileBase
    {
        //Variables/Constants
        public InstanceInfo[] InstanceInfos;
        public string[] TerrainModels;

        //Methods
        protected override void Read(ExtendedBinaryReader reader)
        {
            //Root Node
            uint instanceInfoCount = reader.ReadUInt32();
            uint instanceInfoOffsetsOffset = reader.ReadUInt32();

            uint terrainModelCount = reader.ReadUInt32();
            uint terrainModelOffsetsOffset = reader.ReadUInt32();

            //Instance Infos
            InstanceInfos = new InstanceInfo[instanceInfoCount];
            reader.JumpTo(instanceInfoOffsetsOffset, false);

            for (uint i = 0; i < instanceInfoCount; ++i)
            {
                var instanceInfo = new InstanceInfo();
                uint instanceInfoOffset = reader.ReadUInt32();
                var curPos = reader.BaseStream.Position;
                reader.JumpTo(instanceInfoOffset, false);

                uint fileNameCount = reader.ReadUInt32();
                uint fileNameOffsetsOffset = reader.ReadUInt32();
                uint boundingSphereOffset = reader.ReadUInt32();
                reader.JumpTo(fileNameOffsetsOffset, false);

                //File Names
                instanceInfo.FileNames = new string[fileNameCount];

                for (uint i2 = 0; i2 < fileNameCount; ++i2)
                {
                    uint fileNameOffset = reader.ReadUInt32();
                    var curPos2 = reader.BaseStream.Position;
                    reader.JumpTo(fileNameOffset, false);

                    string fileName = reader.ReadNullTerminatedString();
                    instanceInfo.FileNames[i2] = fileName;
                    reader.FixPadding(4);
                    reader.BaseStream.Position = curPos2;
                }

                //Bounding Sphere
                reader.JumpTo(boundingSphereOffset, false);
                instanceInfo.BoundingSphereCenter = reader.ReadVector3();
                instanceInfo.BoundingSphereRadius = reader.ReadSingle();

                InstanceInfos[i] = instanceInfo;
                reader.BaseStream.Position = curPos;
            }

            //Terrain Models
            TerrainModels = new string[terrainModelCount];
            reader.JumpTo(terrainModelOffsetsOffset, false);

            for (uint i = 0; i < terrainModelCount; ++i)
            {
                uint terrainModelOffset = reader.ReadUInt32();
{'fraction_non_alphanumeric': 0.08050763434463613, 'fraction_numerical': 0.01189767995240928, 'mean_word_length': 1.7638356164383562, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2870414', 'n_tokens_mistral': 1294, 'n_tokens_neox': 1201, 'n_words': 253}