6#include <phosphortiles_export.h>
26class ITileAlgorithmRegistry;
60 static constexpr int MaxWatchedFilesPerDir = 100;
68 static constexpr int MaxScripts = 10'000;
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;
Abstract contract for a tiling-algorithm registry.
Definition ITileAlgorithmRegistry.h:41
Discovers, loads, and hot-reloads LuauTileAlgorithm instances.
Definition ScriptedAlgorithmLoader.h:50
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.
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.
LiveReload
Opt-in policy for directory watching.
Definition WatchedDirectorySet.h:34
Definition LuauTileAlgorithm.h:17
Definition AutotileEngine.h:59