Exemplo n.º 1
0
int Lua::LuaInterface::getInt( unsigned int length,QString args[] )
{
	Diluculum::LuaVariable var = ( *luaState )[args[0].toStdString()];
	for ( unsigned int i = 1; i < length; i++ ) {
		var = var[args[i].toStdString()];
	}
	return static_cast<int>( var.value().asInteger() );
}
Exemplo n.º 2
0
double Lua::LuaInterface::getDouble( unsigned int length, QString args[] )
{
	Diluculum::LuaVariable var = ( *luaState )[args[0].toStdString()];
	for ( unsigned int i = 1; i < length; i++ ) {
		var = var[args[i].toStdString()];
	}
	return var.value().asNumber();
}
Exemplo n.º 3
0
QString Lua::LuaInterface::getString( unsigned int length, QString args[] )
{
	Diluculum::LuaVariable var = ( *luaState )[args[0].toStdString()];
	for ( unsigned int i = 1; i < length; i++ ) {
		var = var[args[i].toStdString()];
	}
	return QString::fromStdString( var.value().asString() );
}
Exemplo n.º 4
0
double Lua::LuaInterface::getDouble( QString name )
{
	Diluculum::LuaVariable var = ( *luaState )[name.toStdString()];
	return var.value().asNumber();
}
Exemplo n.º 5
0
int Lua::LuaInterface::getInt( QString name )
{
	Diluculum::LuaVariable var = ( *luaState )[name.toStdString()];
	return static_cast<int>( var.value().asInteger() );
}
Exemplo n.º 6
0
QString Lua::LuaInterface::getString( QString name )
{
	Diluculum::LuaVariable var = ( *luaState )[name.toStdString()];
	return QString::fromStdString( var.value().asString() );
}
Exemplo n.º 7
0
bool SyntaxReader::readFlag(const Diluculum::LuaVariable& var) {
    if (var.value()==Diluculum::Nil) return false;
    return var.value().asBoolean();
}