/// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        private static List <PlayfieldData> ExtractPlayfieldData()
        {
            List <PlayfieldData> playfields = new List <PlayfieldData>(700);

            foreach (int recnum in extractor.GetRecordInstances(1000001))
            {
                PlayfieldData pf = new PlayfieldData();
                pf.PlayfieldId = recnum;

                // Console.WriteLine("Parsing PF " + recnum);
                if (extractor.GetRecordInstances(1000030).Contains(recnum))
                {
                    pf.Doors1 = PlayfieldParser.ParseDoors(extractor.GetRecordData(1000030, recnum));
                }

                pf.Name         = PlayfieldParser.ParseName(extractor.GetRecordData(1000001, recnum));
                pf.Destinations =
                    PlayfieldParser.ParseDestinations(extractor.GetRecordData(1000001, recnum)).Destinations;
                if (extractor.GetRecordInstances(1000021).Contains(recnum))
                {
                    pf.Walls = PlayfieldParser.ParseWalls(extractor.GetRecordData(1000021, recnum));
                }

                playfields.Add(pf);
            }

            return(playfields);
        }
        /// <summary>
        /// </summary>
        /// <param name="playfields">
        /// </param>
        private static void ExtractPlayfieldStatels(List <PlayfieldData> playfields)
        {
            foreach (int recnum in extractor.GetRecordInstances(1000026))
            {
                Console.Write("Parsing Statels for playfield " + recnum + "\r");

                if (playfields.Any(x => x.PlayfieldId == recnum))
                {
                    playfields.First(x => x.PlayfieldId == recnum)
                    .Statels.AddRange(
                        PlayfieldParser.ParseStatels(extractor.GetRecordData(1000026, recnum))

                        /* .Where(x => x.Events.Count > 0)*/);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// </summary>
        /// <returns>
        /// </returns>
        private static List <PlayfieldData> ExtractPlayfieldData()
        {
            List <PlayfieldData> playfields = new List <PlayfieldData>(700);

            int[] instances = extractor.GetRecordInstances(Extractor.RecordType.Playfield);
            foreach (int recnum in instances)
            {
                if (recnum < 120)
                {
                    continue;
                }

                PlayfieldData pf = new PlayfieldData();
                pf.PlayfieldId = recnum;


                int[] doors = extractor.GetRecordInstances(Extractor.RecordType.Door);
                if (doors.Contains(recnum))
                {
                    byte[] doorData = extractor.GetRecordData(Extractor.RecordType.Door, recnum);
                    pf.Doors1 = PlayfieldParser.ParseDoors(doorData);
                }

                pf.Name         = PlayfieldParser.ParseName(extractor.GetRecordData(Extractor.RecordType.Playfield, recnum));
                pf.Destinations = PlayfieldParser.ParseDestinations(extractor.GetRecordData(Extractor.RecordType.Playfield, recnum)).Destinations;

                /*Console.WriteLine("Parsing PF " + recnum+" "+pf.Name);
                 * if (recnum == 500)
                 * {
                 *  Console.ReadLine();
                 * }*/
                if (extractor.GetRecordInstances(Extractor.RecordType.Wall).Contains(recnum))
                {
                    pf.Walls = PlayfieldParser.ParseWalls(extractor.GetRecordData(Extractor.RecordType.Wall, recnum));
                }

                playfields.Add(pf);
            }

            return(playfields);
        }