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

// PURPOSE:

#ifndef BD_MATCHMAKING_QUERIES_H
#define BD_MATCHMAKING_QUERIES_H

#include <bdLobby/bdLobbyCommon/bdCustomQueryParams.h>
#include "CustomMatchMakingInfo.h"

#define MAX_FIND_SESSIONS_BY_GAME_TYPE_RESULTS (25u)

enum SearchId
{
	FIND_SESSIONS_BY_GAME_TYPE = 1
};

/// Encapsulates and handles matchmaking results for a query by session ID.
class FindSessionByIDResult : public bdQueryResult
{
	public :

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

		FindSessionByIDResult();

		virtual ~FindSessionByIDResult();

		virtual bdBool handleResult(const bdUInt numResults, 
									bdBitBufferRef buffer);

		CustomMatchMakingInfo m_customMMInfo;
};

/// Encapsulates a matchmaking query.
class FindSessionsByGameType : public bdCustomQueryParams
{
	public:

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

		FindSessionsByGameType(const bdUInt maxNumResults,
							   const bdInt gameType);

		virtual ~FindSessionsByGameType();

		virtual void serialize(bdBitBuffer &buffer);

	protected:

		bdInt m_gameType;
};

/// Encapsulates and handles results from the query.
class FindSessionsByGameTypeResult : public bdQueryResult
{
	public:

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

		FindSessionsByGameTypeResult();

		virtual ~FindSessionsByGameTypeResult();

		virtual bdBool handleResult(const bdUInt numResults, 
									bdBitBufferRef buffer);		

		CustomMatchMakingInfo m_customMMInfo[MAX_FIND_SESSIONS_BY_GAME_TYPE_RESULTS];
};

#endif // BD_MATCHMAKING_QUERIES_H
