LuaConfig

class rlogic::LuaConfig

Holds configuration settings for Lua script and module creation. Can be default-constructed, moved and copied.

Public Functions

bool addDependency(std::string_view aliasName, const LuaModule &moduleInstance)

Adds a rlogic::LuaModule as a dependency to be added when this config is used for script or module creation. The aliasName can be any valid Lua label which must obey following rules:

  • can’t use the same label twice in the same LuaConfig object

  • can’t use standard module names (math, string etc.)

The moduleInstance provided can be any module. You can’t reference modules from different rlogic::LogicEngine instances and the referenced modules must be from the same instance on which the config is used for script creation.

Return

true if the dependency was added successfully, false otherwise In case of an error, check the logs.

Parameters
  • aliasName: the alias name under which the dependency will be mapped into the parent script/module

  • moduleInstance: the dependency module to map

bool addStandardModuleDependency(EStandardModule stdModule)

Adds a standard module dependency. The module is mapped under a name as documented in rlogic::EStandardModule.

Return

true if the standard module was added successfully, false otherwise In case of an error, check the logs.

Parameters
  • stdModule: the standard module which will be mapped into the parent script/module

void enableDebugLogFunctions()

Will expose these log functions in Lua: rl_logInfo rl_logWarn rl_logError Each with single string as argument. Call from Lua script or module to any of these will forward the string message to a corresponding internal Ramses Logic logger.

IMPORTANT: These functions are meant for debug/prototype purposes only and attempt to save the project to file (rlogic::LogicEngine::saveToFile) with any script or module with these functions enabled will result in failure!

~LuaConfig() noexcept

Destructor of LuaConfig

LuaConfig(const LuaConfig &other)

Copy Constructor of LuaConfig

Parameters
  • other: the other LuaConfig to copy from

LuaConfig(LuaConfig &&other) noexcept

Move Constructor of LuaConfig

Parameters
  • other: the other LuaConfig to move from

LuaConfig &operator=(const LuaConfig &other)

Assignment operator of LuaConfig

Return

self

Parameters
  • other: the other LuaConfig to copy from

LuaConfig &operator=(LuaConfig &&other) noexcept

Move assignment operator of LuaConfig

Return

self

Parameters
  • other: the other LuaConfig to move from

Public Members

std::unique_ptr<internal::LuaConfigImpl> m_impl

Implementation detail of LuaConfig