0966f86f9d
- utilizzato gestore lua di EgtGeneral.
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : LUA_Aux.cpp Data : 29.09.14 Versione : 1.5i5
|
|
// Contenuto : Funzioni ausiliarie per LUA.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 29.09.14 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "LUA_Aux.h"
|
|
#include "AuxTools.h"
|
|
|
|
using namespace std ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaGetRefType( lua_State* L, int nInd, int& nRefType)
|
|
{
|
|
// se non c'è il tipo cercato, ritorno
|
|
string sRefType ;
|
|
if ( ! LuaGetParam( L, nInd, sRefType))
|
|
return false ;
|
|
// interpreto il parametro
|
|
nRefType = StringToRefType( sRefType) ;
|
|
return true ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
LuaGetRefId( lua_State* L, int nInd, int& nRefId)
|
|
{
|
|
// se parametro è numero intero
|
|
if ( LuaGetParam( L, nInd, nRefId))
|
|
return true ;
|
|
// se parametro è stringa
|
|
string sFlag ;
|
|
if ( LuaGetParam( L, nInd, sFlag)) {
|
|
nRefId = StringToRefId( sFlag) ;
|
|
return true ;
|
|
}
|
|
// non trovato
|
|
return false ;
|
|
}
|