23 using callback_t = bool(Mod&);
24 using CallbackFn = std::function<callback_t>;
26 LLNDAPI
explicit Mod(
Manifest manifest);
30 LLNDAPI State getState()
const;
32 LLNDAPI
Manifest const& getManifest()
const;
34 LLNDAPI std::string
const& getName()
const;
36 LLNDAPI std::string
const& getType()
const;
38 LLNDAPI std::filesystem::path
const& getModDir()
const;
40 LLNDAPI std::filesystem::path
const& getDataDir()
const;
42 LLNDAPI std::filesystem::path
const& getConfigDir()
const;
44 LLNDAPI std::optional<std::filesystem::path> getWorldDataDir()
const;
46 LLNDAPI std::optional<std::filesystem::path> getWorldConfigDir()
const;
48 LLNDAPI std::filesystem::path
const& getLangDir()
const;
50 LLNDAPI std::filesystem::path
const& getResourceDir()
const;
52 LLNDAPI std::filesystem::path
const& getBehaviorDir()
const;
56 [[nodiscard]]
bool isEnabled()
const {
return getState() == State::Enabled; }
58 [[nodiscard]]
bool isDisabled()
const {
return getState() == State::Disabled; }
61 LLAPI
void onLoad(CallbackFn func)
noexcept;
63 LLAPI
void onUnload(CallbackFn func)
noexcept;
65 LLAPI
void onEnable(CallbackFn func)
noexcept;
67 LLAPI
void onDisable(CallbackFn func)
noexcept;
70 LLAPI
void release()
noexcept;
72 LLAPI
void setState(State state)
const;
75 LLNDAPI
bool hasOnLoad()
const noexcept;
77 LLNDAPI
bool hasOnUnload()
const noexcept;
79 LLNDAPI
bool hasOnEnable()
const noexcept;
81 LLNDAPI
bool hasOnDisable()
const noexcept;
84 LLAPI Expected<> onLoad()
noexcept;
86 LLAPI Expected<> onUnload()
noexcept;
88 LLAPI Expected<> onEnable()
noexcept;
90 LLAPI Expected<> onDisable()
noexcept;
96 std::unique_ptr<Impl> mImpl;