예제 #1
0
    public void Read(BitStream stream)
    {
        Items.Clear();
        Weapons.Clear();

        Outfits = stream.Read <PPIOutfits>();
        Perk    = stream.Read <E_PerkID>();

        while (stream.isEOF == false)
        {
            switch (stream.Read <E_DatatType>())
            {
            case E_DatatType.None:
                return;

            case E_DatatType.Item:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIItemData d = new PPIItemData();
                    d.Read(stream);
                    Items.Add(d);
                }
            }
            break;

            case E_DatatType.Weapon:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIWeaponData d = new PPIWeaponData();
                    d.Read(stream);
                    Weapons.Add(d);
                }
            }
            break;
            }
        }
    }
예제 #2
0
    public void Read(BitStream stream)
    {
        Items.Clear();
        Weapons.Clear();
        Skins.Clear();
        Hats.Clear();
        Perks.Clear();

        while (stream.isEOF == false)
        {
            switch (stream.Read <E_DatatType>())
            {
            case E_DatatType.None:
                return;

            case E_DatatType.Item:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIItemData d = new PPIItemData();
                    d.Read(stream);
                    Items.Add(d);
                }
            }
            break;

            case E_DatatType.Weapon:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIWeaponData d = new PPIWeaponData();
                    d.Read(stream);
                    Weapons.Add(d);
                }
            }
            break;

            case E_DatatType.Skin:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPISkinData d = new PPISkinData();
                    d.Read(stream);
                    Skins.Add(d);
                }
            }
            break;

            case E_DatatType.Hat:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIHatData d = new PPIHatData();
                    d.Read(stream);
                    Hats.Add(d);
                }
            }
            break;

            case E_DatatType.Perk:
            {
                int count = stream.ReadByte();
                for (int i = 0; i < count; i++)
                {
                    PPIPerkData d = new PPIPerkData();
                    d.Read(stream);
                    Perks.Add(d);
                }
            }
            break;
            }
        }
    }