Esempio n. 1
0
void XGameLua::RegisterGlobal( void )
{
	XLua::RegisterGlobal();
	// C함수 등록
	RegisterCFunc( "Random", LUA::Random );
	RegisterCFunc( "RandomRange", LUA::RandomRange );
	RegisterCFunc( "Console", LUA::Console );
	RegisterCFunc( "XTEXT", LUA::XText );

	Register_Class<XAccount>("XAccount");
	//RegisterCPPFunc<XAccount>("LuaFunc", &XAccount::LuaFunc );

	//
	RegisterVar( "TRUE", TRUE );		// 상수 등록
	RegisterVar( "FALSE", FALSE );
	//
}
Esempio n. 2
0
void Vars::CreateVar(const char *name, int ivalue, int flags)
{
	if (!SetKeyValue(name, ivalue))
	{
		flags |= VF_TEMP;
		Var *v = new Var(name, ivalue, flags);
		RegisterVar(*v);
	}
}
Esempio n. 3
0
ParseEngine::ParseEngine()
{
	//注册默认变量
	NormalVar	*	curVar = new NormalVar("int");
	RegisterVar(curVar);
	curVar = new NormalVar("DWORD");
	RegisterVar(curVar);
	curVar = new NormalVar("short");
	RegisterVar(curVar);
	curVar = new NormalVar("WORD");
	RegisterVar(curVar);
	curVar = new NormalVar("char");
	RegisterVar(curVar);
	curVar = new NormalVar("BYTE");
	RegisterVar(curVar);
	curVar = new NormalVar("float");
	RegisterVar(curVar);
	curVar = new NormalVar("double");
	RegisterVar(curVar);
	curVar = new NormalVar("DateTime");
	RegisterVar(curVar);
}
Esempio n. 4
0
    DiConsoleVar* DiCommandManager::RegisterFloat( const DiString& varName,float fValue,int flags,
        const DiString& desc /*= ""*/,ConsoleVarFunc callFunc/*=0 */ )
    {
        DiConsoleVar *consVar = nullptr;

        auto it = mMapVariables.find(varName);
        if (it != mMapVariables.end())
            consVar = it->second;
        
        if (!consVar)
        {
            consVar = DI_NEW DiConsoleVariableFloat(this, varName, fValue, flags, desc);
            RegisterVar(consVar, callFunc);
        }
        else
        {
            consVar->Set(fValue);
        }

        return consVar;
    }