Esempio n. 1
0
        public GameDataContainer(string pathToYsiExtract)
        {
            stageData = StageData.Load(pathToYsiExtract);
            fruitData = FruitData.Load(pathToYsiExtract);

            IEnumerable <string> maps = Directory.EnumerateFiles(pathToYsiExtract, "MapData*.exbin");

            foreach (string map in maps)
            {
                mapData.Add(Path.GetFileName(map), MapData.Load(map));
            }
        }
Esempio n. 2
0
        private byte[] footerUnknown;                                              // < 3 bytes
        public static FruitData Load(string pathToYsiExtract)
        {
            FruitData fruitData = new FruitData();

            FileStream fs = new FileStream(Path.Combine(pathToYsiExtract, "FruitData.exbin"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

            using (BinaryReader reader = new BinaryReader(fs))
            {
                fruitData.headerUnknown = reader.ReadBytes(16);
                while (reader.BaseStream.Position != reader.BaseStream.Length)
                {
                    Fruit fruit = Fruit.Load(reader);
                    fruitData.payload[fruit.ID] = fruit;
                }
                Debug.Assert(reader.BaseStream.Position == reader.BaseStream.Length, "");
                fruitData.footerUnknown = reader.ReadBytes(13);
            }

            return(fruitData);
        }