6#include "phosphortiles_export.h"
82 QObject* parent =
nullptr);
137 class LuauScanStrategy;
138 QStringList performScan(
const QStringList& directoriesInScanOrder);
157 void loadFromDirectory(
const QString& dir,
bool isUserDir,
const QString& canonicalUserDir,
158 const QHash<QString, ScriptStamp>& prevStamps);
159 QStringList algorithmDirectories()
const;
160 QStringList validatedLuauFiles(
const QString& dirPath,
int maxFiles)
const;
165 std::shared_ptr<PhosphorScripting::LuauEngine> ensureSharedEngine();
167 QString m_subdirectory;
179 std::shared_ptr<PhosphorScripting::LuauWatchdog> m_watchdog;
186 std::shared_ptr<PhosphorScripting::LuauEngine> m_sharedEngine;
187 bool m_sharedEngineFailed =
false;
188 std::unique_ptr<LuauScanStrategy> m_strategy;
189 std::unique_ptr<PhosphorFsLoader::WatchedDirectorySet> m_watcher;
190 QHash<QString, QString> m_scriptIdToPath;
196 QSet<QString> m_refusedFilePaths;
205 QHash<QString, ScriptStamp> m_scriptStamps;
212 QByteArray m_lastScriptSignature;
An embedded, sandboxed Luau virtual machine with a QVariant API.
Definition LuauEngine.h:40
One supervisor thread that interrupts runaway scripts across many engines.
Definition LuauWatchdog.h:38
Abstract contract for a tiling-algorithm registry.
Definition ITileAlgorithmRegistry.h:41
void ensureUserDirectoryExists()
Create the user algorithm directory if it does not exist.
~ScriptedAlgorithmLoader() override
QString userAlgorithmDir() const
Writable user directory path for custom algorithms.
void algorithmsChanged()
Emitted after any add/remove/reload of scripted algorithms.
static constexpr int MaxScripts
Hard cap on scripts REGISTERED per rescan, summed across every registered directory.
Definition ScriptedAlgorithmLoader.h:68
void scanAndRegister(PhosphorFsLoader::LiveReload liveReload=PhosphorFsLoader::LiveReload::On)
Discover and load all .luau algorithms from system + user dirs.
ScriptedAlgorithmLoader(const QString &subdirectory, ITileAlgorithmRegistry *registry, QObject *parent=nullptr)
Construct a loader for subdirectory under XDG data dirs.
static constexpr int MaxWatchedFilesPerDir
Per-directory cap on .luau files considered by one scan.
Definition ScriptedAlgorithmLoader.h:60
LiveReload
Opt-in policy for directory watching.
Definition WatchedDirectorySet.h:40
@ On
Definition WatchedDirectorySet.h:42
Definition LuauEngine.h:19
Definition AutotileEngine.h:52