// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

#include <Composite/bdUserInfo.h>

PrivateProfileInfo::~PrivateProfileInfo()
{
}

void PrivateProfileInfo::serialize(bdBitBuffer& buffer)
{
	buffer.writeString(m_email);
}

bdBool PrivateProfileInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = buffer->readString(m_email);
	return ok;
}

PublicProfileInfo::~PublicProfileInfo()
{
}

void PublicProfileInfo::serialize(bdBitBuffer& buffer)
{
	buffer.writeInt32(m_experiencePoints);
}

bdBool PublicProfileInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = buffer->readInt32(m_experiencePoints);
	return ok;
}

bdBool GetPrivateProfileResult::handleResult(bdUInt numRows, bdBitBufferRef buffer)
{
	bdBool ok = true; 
	if (numRows > 0)
	{
		buffer->readUInt64(profileId);
		ok = data.deserialize(buffer);
	}

	return ok;
}

bdBool GetPublicProfileResult::handleResult(bdUInt numRows, bdBitBufferRef buffer)
{
	bdBool ok = true; 
	if (numRows > 0)
	{
		buffer->readUInt64(profileId);
		ok = data.deserialize(buffer);
	}

	return ok;
}

