/*****************************************************************************
 * $LastChangedDate: 2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Events.
 *//*
 * LEGAL:   COPYRIGHT (C) 2008 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#ifndef COLLISION_EVENTS_HH
#define COLLISION_EVENTS_HH 1

#include <utility>
#include "base/singleton.hh"
#include "base/event.hh"
using namespace base;

namespace collision {

////////////////////////////////////////////////////////////////////////////////
/// @brief Collision events.
///
class Events
{
public:
    DEFINE_GetInstance( Events )  // Singleton

#define EVENT_COLLISION collision::Events::GetInstance().GetCollisionEvent()
    typedef std::pair< shptr<Object>, shptr<Object> > ObjectPair;
    Event<ObjectPair>&  GetCollisionEvent( void ) { return mCollisionEvent; }

private:
    CLASS_VAR Events*   msInstance;
    Event<ObjectPair>   mCollisionEvent;
};

#if COLLISION_COLLISION_CC
Events* Events::msInstance;
#endif

} // namespace collision

#endif // COLLISION_EVENTS_HH
