thanks for that :)
i am really new to AS, thus i still have problems with the most basic things currenty, i hope you dont mind if i ask questions from time to time :)
currently i have a problem to create the interface for one of my classes:
CacheSystem.hi would like to be able to call nearly all functions from AS as well. So i started with adding the Cachesystem and one function:
result = engine->RegisterObjectType("CacheSystemClass", sizeof(CacheSystem), asOBJ_REF); result = engine->RegisterObjectMethod("CacheSystemClass", "string &stripUIDfromString(const string ∈)", asFUNCTION(stripUIDfromString), asCALL_CDECL_OBJLAST); result = engine->RegisterObjectBehaviour("CacheSystemClass", asBEHAVE_ADDREF, "void f()",asMETHOD(CacheSystem,addRef), asCALL_THISCALL); result = engine->RegisterObjectBehaviour("CacheSystemClass", asBEHAVE_RELEASE, "void f()",asMETHOD(CacheSystem,release), asCALL_THISCALL);
and i wrote a wrapper for the string result that this function returns:
CScriptString &stripUIDfromString(std::string str){ CScriptString *rstr = new CScriptString(CACHE.stripUIDfromString(str).c_str()); return *rstr;}
is it always required to write such a wrapper or could i somehow use the function directly (Ogre::String is in fact std::string)?
also, how do i prevent the AS from creating new instances of the class? it should just be able to communicate with my singleton created in c++.
thank you very much :)