/*****************************************************************************
 * $LastChangedDate: 2011-04-09 21:58:06 -0400 (Sat, 09 Apr 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   A part of the C++ core that calls Lua functions.
 *//*
 * 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 GLUE_CORE2LUA_HH
#define GLUE_CORE2LUA_HH 1

#include "base/singleton.hh"
using namespace base;
#include "object/module.hh"
#include "object/events.hh"
using namespace object;
#include "collision/module.hh"
#include "collision/events.hh"
using namespace collision;

namespace glue {

////////////////////////////////////////////////////////////////////////////////
/// @brief Glue code between C++ core and Lua.
///
/// The purpose of this class is to centralize where C++ core calls Lua.
///
class Core2Lua
{
PREVENT_COPYING(Core2Lua)
public:
    DEFINE_GetInstance( Core2Lua )  // Singleton

private:
    Core2Lua( void );
    ~Core2Lua();

private:
    CLASS_DESTROY_OBJECT_LISTENER( Core2Lua, mCoreToLua )
    CLASS_EVENT_LISTENER( CollisionListener, collision::Events::ObjectPair, Core2Lua, mCore2Lua )

private:
    CLASS_VAR Core2Lua* msInstance;
};

} // namespace glue

#endif // GLUE_CORE2LUA_HH
