<commit_before>﻿using System.IO;

namespace OpenSage.Data.Map
{
    public sealed class GlobalLightingConfiguration
    {
        public GlobalLight TerrainSun { get; private set; }
        public GlobalLight TerrainAccent1 { get; private set; }
        public GlobalLight TerrainAccent2 { get; private set; }

        public GlobalLight ObjectSun { get; private set; }
        public GlobalLight ObjectAccent1 { get; private set; }
        public GlobalLight ObjectAccent2 { get; private set; }

        public GlobalLight InfantrySun { get; private set; }
        public GlobalLight InfantryAccent1 { get; private set; }
        public GlobalLight InfantryAccent2 { get; private set; }

        internal static GlobalLightingConfiguration Parse(BinaryReader reader, uint version)
        {
            var result = new GlobalLightingConfiguration();

            result.TerrainSun = GlobalLight.Parse(reader);

            if (version < 11)
            {
                result.ObjectSun = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantrySun = GlobalLight.Parse(reader);
                }
            }

            result.TerrainAccent1 = GlobalLight.Parse(reader);

            if (version < 11)
            {
                result.ObjectAccent1 = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantryAccent1 = GlobalLight.Parse(reader);
                }
            }

            result.TerrainAccent2 = GlobalLight.Parse(reader);

            if (version < 11)
            {
                result.ObjectAccent2 = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantryAccent2 = GlobalLight.Parse(reader);
                }
            }

            return result;
        }

        internal void WriteTo(BinaryWriter writer, uint version)
        {
            TerrainSun.WriteTo(writer);

            if (version < 11)
            {
                ObjectSun.WriteTo(writer);

                if (version >= 7)
                {
                    InfantrySun.WriteTo(writer);
                }
            }

            TerrainAccent1.WriteTo(writer);

            if (version < 11)
            {
                ObjectAccent1.WriteTo(writer);

                if (version >= 7)
                {
                    InfantryAccent1.WriteTo(writer);
                }
            }

            TerrainAccent2.WriteTo(writer);

            if (version < 11)
            {
                ObjectAccent2.WriteTo(writer);

                if (version >= 7)
                {
                    InfantryAccent2.WriteTo(writer);
                }
            }
        }
    }
}<commit_msg>Fix parsing for v10 of GlobalLighting map chunk<commit_after>﻿using System.IO;

namespace OpenSage.Data.Map
{
    public sealed class GlobalLightingConfiguration
    {
        public GlobalLight TerrainSun { get; private set; }
        public GlobalLight TerrainAccent1 { get; private set; }
        public GlobalLight TerrainAccent2 { get; private set; }

        public GlobalLight ObjectSun { get; private set; }
        public GlobalLight ObjectAccent1 { get; private set; }
        public GlobalLight ObjectAccent2 { get; private set; }

        public GlobalLight InfantrySun { get; private set; }
        public GlobalLight InfantryAccent1 { get; private set; }
        public GlobalLight InfantryAccent2 { get; private set; }

        internal static GlobalLightingConfiguration Parse(BinaryReader reader, uint version)
        {
            var result = new GlobalLightingConfiguration();

            result.TerrainSun = GlobalLight.Parse(reader);

            if (version < 10)
            {
                result.ObjectSun = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantrySun = GlobalLight.Parse(reader);
                }
            }

            result.TerrainAccent1 = GlobalLight.Parse(reader);

            if (version < 10)
            {
                result.ObjectAccent1 = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantryAccent1 = GlobalLight.Parse(reader);
                }
            }

            result.TerrainAccent2 = GlobalLight.Parse(reader);

            if (version < 10)
            {
                result.ObjectAccent2 = GlobalLight.Parse(reader);

                if (version >= 7)
                {
                    result.InfantryAccent2 = GlobalLight.Parse(reader);
                }
            }

            return result;
        }

        internal void WriteTo(BinaryWriter writer, uint version)
        {
            TerrainSun.WriteTo(writer);

            if (version < 10)
            {
                ObjectSun.WriteTo(writer);

                if (version >= 7)
                {
                    InfantrySun.WriteTo(writer);
                }
            }

            TerrainAccent1.WriteTo(writer);

            if (version < 10)
            {
                ObjectAccent1.WriteTo(writer);

                if (version >= 7)
                {
                    InfantryAccent1.WriteTo(writer);
                }
            }

            TerrainAccent2.WriteTo(writer);

            if (version < 10)
            {
                ObjectAccent2.WriteTo(writer);

                if (version >= 7)
                {
                    InfantryAccent2.WriteTo(writer);
                }
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.07799145299145299, 'fraction_numerical': 0.013176638176638177, 'mean_word_length': 1.3020491803278689, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3224493', 'n_tokens_mistral': 1497, 'n_tokens_neox': 1335, 'n_words': 295}