// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS
// PURPOSE: The result set of a call to bdFriends::getFriends().

#ifndef BD_GET_FRIENDS_RESULT_H
#define BD_GET_FRIENDS_RESULT_H

#include <bdCore/bdCore.h>

#include <bdLobby/bdLobbyCommon/bdLobbyServicesCommon.h>
#include <bdLobby/bdLobbyCommon/bdQueryResult.h>

/// The result set of a call to bdFriends::getFriends().
/// An instance of this class should be passed to bdFriends::handleTask following
/// successful completion of a task returned from getFriends() function.
class bdGetFriendsResult : public bdQueryResult
{
	public:
		BD_DECLARE_NEW_AND_DELETE_OPERATORS
		
		class bdFriend
		{
		public:
			BD_DECLARE_NEW_AND_DELETE_OPERATORS
			~bdFriend(){};
			bdOnlineUserID m_userID;
			bdNChar8 m_userName[BD_MAX_USERNAME_LENGTH];
			bdBool m_isOnline;
		};

		bdGetFriendsResult();

		~bdGetFriendsResult();

		bdBool handleResult(const bdUInt numRows, 
							bdBitBufferRef buffer);

		/// After passing an instance of this class to bdFriends::handleTask,
		/// this array will contain entries for each friend, also indicated
		/// each friend's online status.
		bdArray<bdFriend> m_friends;
};

#endif // BD_GET_FRIENDS_RESULT_H
