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

#ifndef BD_EXAMPLE_COMMON_H
#define BD_EXAMPLE_COMMON_H

#include <bdCore/bdCore.h>

#include <bdMath/bdVector4.h>

#include <bdExampleCommon/Sphere.h>
#include <bdExampleCommon/bdExamplePlatformInit.h>

#include <bdNet/bdNet.h>

#include <bdGraphics/bdDemo.h>

#include <bdConnection/bdConnectionListener.h>

#include <bdNet/bdBandwidthMonitor/bdBandwidthListener.h>
#include <bdNet/bdBandwidthMonitor/bdBandwidthMonitor.h>
#include <bdNet/bdDispatch/bdDispatchInterceptor.h>
#include <bdNet/bdDiscovery/bdDiscoveryServer.h>
#include <bdNet/bdDiscovery/bdDiscoveryClient.h>
#include <bdNet/bdDiscovery/bdGameInfoFactory.h>
#include <bdNet/bdStream/bdOutStream.h>
#include <bdNet/bdStream/bdInStream.h>
#include <bdNet/bdStream/bdStreamListener.h>

#include <bdPlatform/bdPlatformTiming/bdPlatformTiming.h>

class DiscoveryManager : public bdDiscoveryListener
{

	public:

		virtual ~DiscoveryManager();

		bdGameInfoRef discoverLanGames(const bdUInt32 titleID);

		bdGameInfoRef createGame(const bdUInt32 titleID);

		bdGameInfoRef directConnect(const bdUInt32 titleID,
									const bdNChar8 *const publicAddr);

		virtual void onDiscovery(bdGameInfoRef gameInfo);

	protected:

		/// A linked list of games we found
		bdLinkedList<bdGameInfoRef> m_gameList;

};

#endif // BD_EXAMPLE_COMMON_H
