Exemplo n.º 1
0
        internal static GlobalLightingConfiguration Parse(BinaryReader reader)
        {
            return(new GlobalLightingConfiguration
            {
                TerrainSun = GlobalLight.Parse(reader),
                ObjectSun = GlobalLight.Parse(reader),

                TerrainAccent1 = GlobalLight.Parse(reader),
                TerrainAccent2 = GlobalLight.Parse(reader),

                ObjectAccent1 = GlobalLight.Parse(reader),
                ObjectAccent2 = GlobalLight.Parse(reader),
            });
        }
        internal static GlobalLightingConfiguration Parse(BinaryReader reader, uint version)
        {
            var terrainSun = GlobalLight.Parse(reader);
            var objectSun  = GlobalLight.Parse(reader);

            GlobalLight infantrySun = null;

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

            var terrainAccent1 = GlobalLight.Parse(reader);
            var objectAccent1  = GlobalLight.Parse(reader);

            GlobalLight infantryAccent1 = null;

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

            var terrainAccent2 = GlobalLight.Parse(reader);
            var objectAccent2  = GlobalLight.Parse(reader);

            GlobalLight infantryAccent2 = null;

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

            return(new GlobalLightingConfiguration
            {
                TerrainSun = terrainSun,
                ObjectSun = objectSun,
                InfantrySun = infantrySun,

                TerrainAccent1 = terrainAccent1,
                TerrainAccent2 = terrainAccent2,
                InfantryAccent1 = infantryAccent1,

                ObjectAccent1 = objectAccent1,
                ObjectAccent2 = objectAccent2,
                InfantryAccent2 = infantryAccent2
            });
        }
Exemplo n.º 3
0
        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);
        }