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

#include <bdLobby/bdChannelChat/bdGetChannelsResult.h>

bdGetChannelsResult::bdGetChannelsResult()
{
}

bdGetChannelsResult::~bdGetChannelsResult()
{
	m_channelList.clear();
}

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

	for(bdUInt i=0; ok && (i < numResults); i++)
	{
		bdChannelInfo channel;

		ok = channel.deserialize(buffer);

		if (ok)
		{
			m_channelList.pushBack(channel);
		}
	}

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

