public void Unpack(BinaryReader reader) { uint PackedAmount = reader.ReadUInt32(); if ((PackedAmount & 0x800000) != 0) // Is the subvalue negative? { Amount = (int)(PackedAmount & 0xFFFFFF | 0xFF000000); } else { Amount = (int)(PackedAmount & 0xFFFFFF); } PwdType = (sbyte)(PackedAmount >> 24); ObjectID = reader.ReadUInt32(); switch (PwdType) { case -1: Pwd.Unpack(reader); break; case 1: Opwd.Unpack(reader); break; } }