Exemplo n.º 1
0
    public static List <LevelMetaData> Parse(string path)
    {
        using (BinaryReader b = new BinaryReader(File.Open(path, FileMode.Open)))
        {
            var res = new List <LevelMetaData>();
            while (b.BaseStream.Position != b.BaseStream.Length)
            {
                var m = new LevelMetaData();
                for (int i = 0; i < 20; i++)
                {
                    m.randomRectsCoords[i] = RandomRectCoords.Parse(b);
                }

                for (int i = 0; i < 20; i++)
                {
                    m.TimesIn10k[i] = b.ReadInt16().SwapBytes();
                }

                for (int i = 0; i < 20; i++)
                {
                    m.BattleRange[i] = RandomRectBattleRange.Parse(b);
                }

                for (int i = 0; i < 20; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        m.XapNum[i, j] = b.ReadInt16().SwapBytes();
                    }
                }

                for (int i = 0; i < 20; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        m.XapChance[i, j] = b.ReadInt16().SwapBytes();
                    }
                }

                m.LandType      = b.ReadByte();
                m.unknown       = b.ReadBytes(0x16);
                m.PercentOption = b.ReadBytes(20);
                m.unused        = b.ReadByte();

                for (int i = 0; i < 20; i++)
                {
                    m.sound[i] = b.ReadInt16().SwapBytes();
                }

                for (int i = 0; i < 20; i++)
                {
                    m.text[i] = b.ReadInt16().SwapBytes();
                }
                res.Add(m);
            }
            return(res);
        }
    }
Exemplo n.º 2
0
    internal static RandomRectBattleRange Parse(BinaryReader b)
    {
        var r = new RandomRectBattleRange
        {
            Low  = b.ReadInt16().SwapBytes(),
            High = b.ReadInt16().SwapBytes()
        };

        return(r);
    }