Пример #1
0
    public static object Deserialize(BitStream stream, params object[] args)
    {
        PPIOutfits ppi = new PPIOutfits();

        ppi.Read(stream);
        return(ppi);
    }
Пример #2
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;
            }
        }
    }
Пример #3
0
    public static void Serialize(BitStream stream, object value, params object[] args)
    {
        PPIOutfits ppi = (PPIOutfits)value;

        ppi.Write(stream);
    }