Ejemplo n.º 1
0
        public override Record Deserialize(World input)
        {
            var record  = new Record(RecordName);
            var records = new MultipleRecords();

            if (input.GscFileName != null)
            {
                records.Records.Add(GscFile, RecordExtensions.GetSingleDataRecord(GscFile, input.GscFileName));
            }
            if (input.Administration.MultipleRecords != null)
            {
                records.AddMultipleRecords(Administration, input.Administration.MultipleRecords);
            }
            records.AddMixedDataRecord(MissionObjects, MissionObjectsSerializer.Deserialize(input.MissionObjects));
            records.AddMixedDataRecord(Patrols, PatrolsSerializer.Deserialize(input.Patrols));
            if (input.SpecialAreas.MultipleRecords != null)
            {
                records.AddMixedDataRecord(SpecialAreas, input.SpecialAreas.MultipleRecords);
            }
            if (input.SoundAreas.MultipleRecords != null)
            {
                records.AddMixedDataRecord(SoundAreas, input.SoundAreas.MultipleRecords);
            }
            record.Data = records;
            return(record);
        }
Ejemplo n.º 2
0
        public static MultipleRecords GetMultipleRecords(Mission mission)
        {
            var records = new MultipleRecords();

            records.Records.Add(MsbFile, RecordExtensions.GetSingleDataRecord(MsbFile, mission.MsbFileName));
            records.Records.Add(BasFile, RecordExtensions.GetSingleDataRecord(BasFile, mission.BasFileName));
            records.Records.Add(CameraSerializer.Camera, SerializerHelper.Instance.CameraSerializer.Deserialize(mission.Camera));
            records.Records.Add(BriefingSerializer.Briefing, SerializerHelper.Instance.BriefingSerializer.Deserialize(mission.Briefing));
            records.Records.Add(MusicSerializer.Music, SerializerHelper.Instance.MusicSerializer.Deserialize(mission.Music));
            records.Records.Add(FicherosSerializer.Ficheros, SerializerHelper.Instance.FicherosSerializer.Deserialize(mission.Ficheros));
            if (mission.Abilities.MultipleRecords != null)
            {
                records.AddMultipleRecords(StringConstants.Abilities, mission.Abilities.MultipleRecords);
            }
            records.Records.Add(WorldSerializer.World, SerializerHelper.Instance.WorldSerializer.Deserialize(mission.World));
            return(records);
        }