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

#include <bdLobby/bdTeams/bdGetTeamsProposalListResult.h>

bdGetTeamsProposalListResult::bdGetTeamsProposalListResult()
{
}

bdGetTeamsProposalListResult::~bdGetTeamsProposalListResult()
{
}

bdBool bdGetTeamsProposalListResult::handleResult(const bdUInt numResults, 
												  bdBitBufferRef buffer)
{
	bdBool ok = true;

	for(bdUInt i=0; ok && (i < numResults); i++)
	{
		bdGetTeamsProposalListResult::bdPotentialMember potentialMember;

		ok = buffer->readUInt64(potentialMember.m_userID);
		ok = ok && buffer->readUInt64(potentialMember.m_teamID);
		ok = ok && buffer->readString(potentialMember.m_userName, BD_MAX_USERNAME_LENGTH);
		ok = ok && buffer->readString(potentialMember.m_teamName, BD_MAX_TEAMNAME_LENGTH);

		if(ok)
		{
			m_proposalList.pushBack(potentialMember);
		}
	}

	m_numResults = m_proposalList.getSize();
	return ok;
}

