public static EmitterSaveList FromFile(string fileName)
        {
            EmitterSaveList emitterSaveListToReturn =
                FileManager.XmlDeserialize <EmitterSaveList>(fileName);

            emitterSaveListToReturn.Name = fileName;

            if (FileManager.IsRelative(emitterSaveListToReturn.Name))
            {
                emitterSaveListToReturn.Name = FileManager.MakeAbsolute(emitterSaveListToReturn.Name);
            }

            foreach (EmitterSave es in emitterSaveListToReturn.emitters)
            {
                es.FileName = fileName;
            }

#if FRB_MDX
            if (emitterSaveListToReturn.CoordinateSystem == CoordinateSystem.RightHanded)
            {
                emitterSaveListToReturn.InvertZ();
                emitterSaveListToReturn.CoordinateSystem = CoordinateSystem.LeftHanded;
            }
#else
            if (emitterSaveListToReturn.CoordinateSystem == CoordinateSystem.LeftHanded)
            {
                emitterSaveListToReturn.InvertZ();
                emitterSaveListToReturn.CoordinateSystem = CoordinateSystem.RightHanded;
            }
#endif

            return(emitterSaveListToReturn);
        }
        public static EmitterSaveList FromEmitterList(IEnumerable <Emitter> emittersToSave)
        {
            EmitterSaveList emitterSaveList = new EmitterSaveList();

            foreach (Emitter emitter in emittersToSave)
            {
                EmitterSave emitterSave = EmitterSave.FromEmitter(emitter);
                emitterSaveList.emitters.Add(emitterSave);
            }

            return(emitterSaveList);
        }
Esempio n. 3
0
        public static EmitterSaveList FromEmitterList(IEnumerable<Emitter> emittersToSave)
        {
            EmitterSaveList emitterSaveList = new EmitterSaveList();
            
            foreach (Emitter emitter in emittersToSave)
            {
                EmitterSave emitterSave = EmitterSave.FromEmitter(emitter);
                emitterSaveList.emitters.Add(emitterSave);
            }

            return emitterSaveList;
        }