Пример #1
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            Key.WriteTo(writer, assetNames);

            switch (Key.PropertyType)
            {
            case AssetPropertyType.Boolean:
                writer.Write((bool)Value);
                break;

            case AssetPropertyType.Integer:
                writer.Write((uint)Value);
                break;

            case AssetPropertyType.RealNumber:
                writer.Write((float)Value);
                break;

            case AssetPropertyType.AsciiString:
                writer.WriteUInt16PrefixedAsciiString((string)Value);
                break;

            case AssetPropertyType.Unknown:
                writer.WriteUInt16PrefixedAsciiString((string)Value);
                break;

            case AssetPropertyType.UnicodeString:
                writer.WriteUInt16PrefixedUnicodeString((string)Value);
                break;

            default:
                throw new InvalidDataException($"Unexpected property type: {Key.PropertyType}.");
            }
        }
Пример #2
0
        private void WriteMapDataTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            writer.Write(assetNames.GetOrCreateAssetIndex(HeightMapData.AssetName));
            HeightMapData.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(BlendTileData.AssetName));
            BlendTileData.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(WorldInfo.AssetName));
            WorldInfo.WriteTo(writer, assetNames);

            writer.Write(assetNames.GetOrCreateAssetIndex(SidesList.AssetName));
            SidesList.WriteTo(writer, assetNames);

            writer.Write(assetNames.GetOrCreateAssetIndex(ObjectsList.AssetName));
            ObjectsList.WriteTo(writer, assetNames);

            writer.Write(assetNames.GetOrCreateAssetIndex(PolygonTriggers.AssetName));
            PolygonTriggers.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(GlobalLighting.AssetName));
            GlobalLighting.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(WaypointsList.AssetName));
            WaypointsList.WriteTo(writer);
        }
Пример #3
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         Properties.WriteTo(writer, assetNames);
     });
 }
Пример #4
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                if (Version >= 6)
                {
                    writer.Write(Unknown);
                }

                writer.Write((uint)Players.Length);

                foreach (var player in Players)
                {
                    player.WriteTo(writer, assetNames, Version);
                }

                if (Version >= 5)
                {
                    return;
                }

                writer.Write((uint)Teams.Length);

                foreach (var team in Teams)
                {
                    team.WriteTo(writer, assetNames);
                }

                if (PlayerScripts != null)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(PlayerScriptsList.AssetName));
                    PlayerScripts.WriteTo(writer, assetNames);
                }
            });
        }
Пример #5
0
        internal void WriteTo(
            BinaryWriter writer,
            AssetNameCollection assetNames,
            ushort minimumVersionThatHasInternalName,
            ushort minimumVersionThatHasEnabledFlag,
            Action derivedWriteTo = null)
        {
            WriteAssetTo(writer, () =>
            {
                writer.Write((uint)(object)ContentType);

                if (Version >= minimumVersionThatHasInternalName)
                {
                    InternalName.WriteTo(writer, assetNames);
                }

                writer.Write((uint)Arguments.Length);

                foreach (var argument in Arguments)
                {
                    argument.WriteTo(writer);
                }

                if (Version >= minimumVersionThatHasEnabledFlag)
                {
                    writer.WriteBooleanUInt32(Enabled);
                }

                derivedWriteTo?.Invoke();
            });
        }
Пример #6
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                writer.WriteUInt16PrefixedAsciiString(Name);

                writer.WriteUInt16PrefixedAsciiString(Comment);
                writer.WriteUInt16PrefixedAsciiString(ConditionsComment);
                writer.WriteUInt16PrefixedAsciiString(ActionsComment);

                writer.Write(IsActive);
                writer.Write(DeactivateUponSuccess);

                writer.Write(ActiveInEasy);
                writer.Write(ActiveInMedium);
                writer.Write(ActiveInHard);

                writer.Write(IsSubroutine);

                if (Version >= 2)
                {
                    writer.Write(EvaluationInterval);

                    if (Version >= 5)
                    {
                        writer.Write(UsesEvaluationIntervalType);
                        writer.Write((uint)EvaluationIntervalType);
                    }
                }

                if (Version >= 4)
                {
                    writer.Write(ActionsFireSequentially);
                    writer.Write(LoopActions);
                    writer.Write(LoopCount);
                    writer.Write((byte)SequentialTargetType);
                    writer.WriteUInt16PrefixedAsciiString(SequentialTargetName);
                    writer.WriteUInt16PrefixedAsciiString(Unknown);
                }

                foreach (var orCondition in OrConditions)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptOrCondition.AssetName));
                    orCondition.WriteTo(writer, assetNames);
                }

                foreach (var scriptAction in ActionsIfTrue)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptAction.AssetNameTrue));
                    scriptAction.WriteTo(writer, assetNames);
                }

                foreach (var scriptAction in ActionsIfFalse)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptAction.AssetNameFalse));
                    scriptAction.WriteTo(writer, assetNames);
                }
            });
        }
Пример #7
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            writer.Write((ushort)Count);

            foreach (var property in this)
            {
                property.WriteTo(writer, assetNames);
            }
        }
Пример #8
0
        private static MapFile ParseMapData(BinaryReader reader)
        {
            var assetNames = AssetNameCollection.Parse(reader);

            var result = new MapFile();

            var context = new MapParseContext(assetNames);

            context.PushAsset(nameof(MapFile), reader.BaseStream.Length);

            Asset.ParseAssets(reader, context, assetName =>
            {
                switch (assetName)
                {
                case HeightMapData.AssetName:
                    result.HeightMapData = HeightMapData.Parse(reader, context);
                    break;

                case BlendTileData.AssetName:
                    result.BlendTileData = BlendTileData.Parse(reader, context, result.HeightMapData);
                    break;

                case WorldInfo.AssetName:
                    result.WorldInfo = WorldInfo.Parse(reader, context);
                    break;

                case SidesList.AssetName:
                    result.SidesList = SidesList.Parse(reader, context);
                    break;

                case ObjectsList.AssetName:
                    result.ObjectsList = ObjectsList.Parse(reader, context);
                    break;

                case PolygonTriggers.AssetName:
                    result.PolygonTriggers = PolygonTriggers.Parse(reader, context);
                    break;

                case GlobalLighting.AssetName:
                    result.GlobalLighting = GlobalLighting.Parse(reader, context);
                    break;

                case WaypointsList.AssetName:
                    result.WaypointsList = WaypointsList.Parse(reader, context);
                    break;

                default:
                    throw new NotImplementedException(assetName);
                }
            });

            context.PopAsset();

            return(result);
        }
Пример #9
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         foreach (var mapObject in Objects)
         {
             writer.Write(assetNames.GetOrCreateAssetIndex(MapObject.AssetName));
             mapObject.WriteTo(writer, assetNames);
         }
     });
 }
Пример #10
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         foreach (var list in Lists)
         {
             writer.Write(assetNames.GetOrCreateAssetIndex(LibraryMaps.AssetName));
             list.WriteTo(writer, assetNames);
         }
     });
 }
Пример #11
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         foreach (var position in Positions)
         {
             writer.Write(assetNames.GetOrCreateAssetIndex(MPPositionInfo.AssetName));
             position.WriteTo(writer);
         }
     });
 }
Пример #12
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames, ushort version)
        {
            Properties.WriteTo(writer, assetNames);

            writer.Write((uint)BuildList.Length);

            foreach (var buildListItem in BuildList)
            {
                buildListItem.WriteTo(writer, version);
            }
        }
Пример #13
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         foreach (var scriptList in ScriptLists)
         {
             writer.Write(assetNames.GetOrCreateAssetIndex(ScriptList.AssetName));
             scriptList.WriteTo(writer, assetNames);
         }
     });
 }
Пример #14
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         writer.Write(Position);
         writer.Write(Angle);
         writer.Write((uint)RoadType);
         writer.WriteUInt16PrefixedAsciiString(TypeName);
         Properties.WriteTo(writer, assetNames);
     });
 }
Пример #15
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteAssetTo(writer, () =>
     {
         foreach (var condition in Conditions)
         {
             writer.Write(assetNames.GetOrCreateAssetIndex(ScriptCondition.AssetName));
             condition.WriteTo(writer, assetNames);
         }
     });
 }
Пример #16
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                writer.Write((uint)Values.Length);

                foreach (var value in Values)
                {
                    writer.WriteUInt16PrefixedAsciiString(value);
                }
            });
        }
Пример #17
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames, bool mapHasAssetList)
        {
            WriteAssetTo(writer, () =>
            {
                writer.Write((uint)Items.Length);

                foreach (var buildList in Items)
                {
                    buildList.WriteTo(writer, assetNames, Version, mapHasAssetList);
                }
            });
        }
Пример #18
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                writer.Write((uint)Items.Length);

                foreach (var team in Items)
                {
                    team.WriteTo(writer, assetNames);
                }
            });
        }
Пример #19
0
        private void WriteMapDataTo(BinaryWriter writer)
        {
            var assetNames = new AssetNameCollection();

            // Do a first pass just to collect the asset names.
            var tempWriter = BinaryWriter.Null;

            WriteMapDataTo(tempWriter, assetNames);

            // Now write out the asset names to the real writer.
            assetNames.WriteTo(writer);

            // And write out the data to the real writer.
            WriteMapDataTo(writer, assetNames);
        }
Пример #20
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                writer.WriteUInt16PrefixedAsciiString(Name);
                writer.Write(IsActive);
                writer.Write(IsSubroutine);

                foreach (var script in Scripts)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(Script.AssetName));
                    script.WriteTo(writer, assetNames);
                }
            });
        }
Пример #21
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteTo(
         writer,
         assetNames,
         MinimumVersionThatHasInternalName,
         MinimumVersionThatHasEnabledFlag,
         () =>
     {
         if (Version >= MinimumVersionThatHasEnabledFlag)
         {
             writer.WriteBooleanUInt32(IsInverted);
         }
     });
 }
Пример #22
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames, ushort version, bool mapHasAssetList)
        {
            if (mapHasAssetList)
            {
                writer.WriteUInt16PrefixedAsciiString(FactionName);
            }
            else
            {
                FactionNameProperty.WriteTo(writer, assetNames);
            }

            writer.Write((uint)Items.Length);

            foreach (var buildListItem in Items)
            {
                buildListItem.WriteTo(writer, version, 1, mapHasAssetList);
            }
        }
Пример #23
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                PropertyKey.WriteTo(writer, assetNames);

                writer.Write((uint)Templates.Length);
                for (var i = 0; i < Templates.Length; i++)
                {
                    Templates[i].WriteTo(writer, Version);
                }

                if (Version >= 2)
                {
                    Perimeter.WriteTo(writer, Version);
                }
            });
        }
Пример #24
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            WriteAssetTo(writer, () =>
            {
                writer.WriteUInt16PrefixedAsciiString(Name);

                writer.WriteUInt16PrefixedAsciiString(Comment);
                writer.WriteUInt16PrefixedAsciiString(ConditionsComment);
                writer.WriteUInt16PrefixedAsciiString(ActionsComment);

                writer.Write(IsActive);
                writer.Write(DeactivateUponSuccess);

                writer.Write(ActiveInEasy);
                writer.Write(ActiveInMedium);
                writer.Write(ActiveInHard);

                writer.Write(IsSubroutine);

                if (Version > 1)
                {
                    writer.Write(EvaluationInterval);
                }

                foreach (var orCondition in OrConditions)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptOrCondition.AssetName));
                    orCondition.WriteTo(writer, assetNames);
                }

                foreach (var scriptAction in ActionsIfTrue)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptAction.AssetNameTrue));
                    scriptAction.WriteTo(writer, assetNames);
                }

                foreach (var scriptAction in ActionsIfFalse)
                {
                    writer.Write(assetNames.GetOrCreateAssetIndex(ScriptAction.AssetNameFalse));
                    scriptAction.WriteTo(writer, assetNames);
                }
            });
        }
Пример #25
0
        public static AssetNameCollection Parse(BinaryReader reader)
        {
            var numAssetStrings = reader.ReadUInt32();

            var result = new AssetNameCollection();

            for (var i = numAssetStrings; i >= 1; i--)
            {
                var assetName  = reader.ReadString();
                var assetIndex = reader.ReadUInt32();
                if (assetIndex != i)
                {
                    throw new InvalidDataException();
                }
                result.AddAssetName(assetIndex, assetName);
            }

            return(result);
        }
Пример #26
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames, ushort minimumVersionThatHasInternalName)
        {
            WriteAssetTo(writer, () =>
            {
                writer.Write((uint)(object)ContentType);

                if (Version >= minimumVersionThatHasInternalName)
                {
                    writer.Write(MagicValue);

                    writer.WriteUInt24(assetNames.GetOrCreateAssetIndex(InternalName));
                }

                writer.Write((uint)Arguments.Length);

                foreach (var argument in Arguments)
                {
                    argument.WriteTo(writer);
                }
            });
        }
Пример #27
0
        private void WriteMapDataTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            if (AssetList != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(AssetList.AssetName));
                AssetList.WriteTo(writer);
            }

            if (GlobalVersion != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(GlobalVersion.AssetName));
                GlobalVersion.WriteTo(writer);
            }

            writer.Write(assetNames.GetOrCreateAssetIndex(HeightMapData.AssetName));
            HeightMapData.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(BlendTileData.AssetName));
            BlendTileData.WriteTo(writer);

            writer.Write(assetNames.GetOrCreateAssetIndex(WorldInfo.AssetName));
            WorldInfo.WriteTo(writer, assetNames);

            if (MPPositionList != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(MPPositionList.AssetName));
                MPPositionList.WriteTo(writer, assetNames);
            }

            writer.Write(assetNames.GetOrCreateAssetIndex(SidesList.AssetName));
            SidesList.WriteTo(writer, assetNames, AssetList != null);

            if (LibraryMapLists != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(LibraryMapLists.AssetName));
                LibraryMapLists.WriteTo(writer, assetNames);
            }

            if (Teams != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(Teams.AssetName));
                Teams.WriteTo(writer, assetNames);
            }

            if (PlayerScriptsList != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(PlayerScriptsList.AssetName));
                PlayerScriptsList.WriteTo(writer, assetNames);
            }

            if (BuildLists != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(BuildLists.AssetName));
                BuildLists.WriteTo(writer, assetNames, AssetList != null);
            }

            writer.Write(assetNames.GetOrCreateAssetIndex(ObjectsList.AssetName));
            ObjectsList.WriteTo(writer, assetNames);

            if (PolygonTriggers != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(PolygonTriggers.AssetName));
                PolygonTriggers.WriteTo(writer);
            }

            if (TriggerAreas != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(TriggerAreas.AssetName));
                TriggerAreas.WriteTo(writer);
            }

            if (GlobalWaterSettings != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(GlobalWaterSettings.AssetName));
                GlobalWaterSettings.WriteTo(writer);
            }

            if (FogSettings != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(FogSettings.AssetName));
                FogSettings.WriteTo(writer);
            }

            if (MissionHotSpots != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(MissionHotSpots.AssetName));
                MissionHotSpots.WriteTo(writer);
            }

            if (MissionObjectives != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(MissionObjectives.AssetName));
                MissionObjectives.WriteTo(writer);
            }

            if (StandingWaterAreas != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(StandingWaterAreas.AssetName));
                StandingWaterAreas.WriteTo(writer);
            }

            if (RiverAreas != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(RiverAreas.AssetName));
                RiverAreas.WriteTo(writer);
            }

            if (StandingWaveAreas != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(StandingWaveAreas.AssetName));
                StandingWaveAreas.WriteTo(writer);
            }

            writer.Write(assetNames.GetOrCreateAssetIndex(GlobalLighting.AssetName));
            GlobalLighting.WriteTo(writer);

            if (PostEffectsChunk != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(PostEffectsChunk.AssetName));
                PostEffectsChunk.WriteTo(writer);
            }

            if (EnvironmentData != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(EnvironmentData.AssetName));
                EnvironmentData.WriteTo(writer);
            }

            if (NamedCameras != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(NamedCameras.AssetName));
                NamedCameras.WriteTo(writer);
            }

            if (CameraAnimationList != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(CameraAnimationList.AssetName));
                CameraAnimationList.WriteTo(writer);
            }

            if (CastleTemplates != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(CastleTemplates.AssetName));
                CastleTemplates.WriteTo(writer, assetNames);
            }

            writer.Write(assetNames.GetOrCreateAssetIndex(WaypointsList.AssetName));
            WaypointsList.WriteTo(writer);

            if (SkyboxSettings != null)
            {
                writer.Write(assetNames.GetOrCreateAssetIndex(SkyboxSettings.AssetName));
                SkyboxSettings.WriteTo(writer);
            }
        }
Пример #28
0
        private static MapFile ParseMapData(BinaryReader reader)
        {
            var assetNames = AssetNameCollection.Parse(reader);

            var result = new MapFile();

            var context = new MapParseContext(assetNames);

            context.PushAsset(nameof(MapFile), reader.BaseStream.Length);

            Asset.ParseAssets(reader, context, assetName =>
            {
                switch (assetName)
                {
                case AssetList.AssetName:
                    result.AssetList = AssetList.Parse(reader, context);
                    break;

                case GlobalVersion.AssetName:
                    result.GlobalVersion = GlobalVersion.Parse(reader, context);
                    break;

                case HeightMapData.AssetName:
                    result.HeightMapData = HeightMapData.Parse(reader, context);
                    break;

                case BlendTileData.AssetName:
                    result.BlendTileData = BlendTileData.Parse(reader, context, result.HeightMapData);
                    break;

                case WorldInfo.AssetName:
                    result.WorldInfo = WorldInfo.Parse(reader, context);
                    break;

                case MPPositionList.AssetName:
                    result.MPPositionList = MPPositionList.Parse(reader, context);
                    break;

                case SidesList.AssetName:
                    result.SidesList = SidesList.Parse(reader, context, result.AssetList != null);
                    break;

                case LibraryMapLists.AssetName:
                    result.LibraryMapLists = LibraryMapLists.Parse(reader, context);
                    break;

                case Teams.AssetName:
                    result.Teams = Teams.Parse(reader, context);
                    break;

                case PlayerScriptsList.AssetName:
                    result.PlayerScriptsList = PlayerScriptsList.Parse(reader, context);
                    break;

                case BuildLists.AssetName:
                    result.BuildLists = BuildLists.Parse(reader, context, result.AssetList != null);
                    break;

                case ObjectsList.AssetName:
                    result.ObjectsList = ObjectsList.Parse(reader, context);
                    break;

                case PolygonTriggers.AssetName:
                    result.PolygonTriggers = PolygonTriggers.Parse(reader, context);
                    break;

                case TriggerAreas.AssetName:
                    result.TriggerAreas = TriggerAreas.Parse(reader, context);
                    break;

                case GlobalWaterSettings.AssetName:
                    result.GlobalWaterSettings = GlobalWaterSettings.Parse(reader, context);
                    break;

                case FogSettings.AssetName:
                    result.FogSettings = FogSettings.Parse(reader, context);
                    break;

                case MissionHotSpots.AssetName:
                    result.MissionHotSpots = MissionHotSpots.Parse(reader, context);
                    break;

                case MissionObjectives.AssetName:
                    result.MissionObjectives = MissionObjectives.Parse(reader, context);
                    break;

                case StandingWaterAreas.AssetName:
                    result.StandingWaterAreas = StandingWaterAreas.Parse(reader, context);
                    break;

                case RiverAreas.AssetName:
                    result.RiverAreas = RiverAreas.Parse(reader, context);
                    break;

                case StandingWaveAreas.AssetName:
                    result.StandingWaveAreas = StandingWaveAreas.Parse(reader, context);
                    break;

                case GlobalLighting.AssetName:
                    result.GlobalLighting = GlobalLighting.Parse(reader, context);
                    break;

                case PostEffectsChunk.AssetName:
                    result.PostEffectsChunk = PostEffectsChunk.Parse(reader, context);
                    break;

                case EnvironmentData.AssetName:
                    result.EnvironmentData = EnvironmentData.Parse(reader, context);
                    break;

                case NamedCameras.AssetName:
                    result.NamedCameras = NamedCameras.Parse(reader, context);
                    break;

                case CameraAnimationList.AssetName:
                    result.CameraAnimationList = CameraAnimationList.Parse(reader, context);
                    break;

                case CastleTemplates.AssetName:
                    result.CastleTemplates = CastleTemplates.Parse(reader, context);
                    break;

                case WaypointsList.AssetName:
                    result.WaypointsList = WaypointsList.Parse(reader, context);
                    break;

                case SkyboxSettings.AssetName:
                    result.SkyboxSettings = SkyboxSettings.Parse(reader, context);
                    break;

                default:
                    throw new NotImplementedException(assetName);
                }
            });

            context.PopAsset();

            return(result);
        }
Пример #29
0
        internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
        {
            writer.Write((byte)PropertyType);

            writer.WriteUInt24(assetNames.GetOrCreateAssetIndex(Name));
        }
Пример #30
0
 internal void WriteTo(BinaryWriter writer, AssetNameCollection assetNames)
 {
     WriteTo(writer, assetNames, MinimumVersionThatHasInternalName);
 }