public void Pack(BinaryWriter writer) { uint PackedAmount = 0; PackedAmount |= (uint)(PwdType << 24); writer.Write(PackedAmount); writer.Write(ObjectID); switch (PwdType) { case -1: Pwd.Pack(writer); break; case 1: Opwd.Pack(writer); break; } }