adapt: adapt LeviLamina v0.12.1
This commit is contained in:
+27
-10
@@ -1,19 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "Config.h"
|
||||
#include <ll/api/plugin/NativePlugin.h>
|
||||
#include <ll/api/schedule/Scheduler.h>
|
||||
|
||||
namespace plugin {
|
||||
namespace Cleaner {
|
||||
|
||||
using namespace ll::schedule;
|
||||
|
||||
class Entry {
|
||||
|
||||
class Plugin {
|
||||
public:
|
||||
explicit Plugin(ll::plugin::NativePlugin& self);
|
||||
static Entry& getInstance();
|
||||
|
||||
Plugin(Plugin&&) = delete;
|
||||
Plugin(const Plugin&) = delete;
|
||||
Plugin& operator=(Plugin&&) = delete;
|
||||
Plugin& operator=(const Plugin&) = delete;
|
||||
Entry(ll::plugin::NativePlugin& self) : mSelf(self) {}
|
||||
|
||||
~Plugin() = default;
|
||||
[[nodiscard]] ll::plugin::NativePlugin& getSelf() const { return mSelf; }
|
||||
|
||||
/// @return True if the plugin is loaded successfully.
|
||||
bool load();
|
||||
|
||||
/// @return True if the plugin is enabled successfully.
|
||||
bool enable();
|
||||
@@ -21,8 +26,20 @@ public:
|
||||
/// @return True if the plugin is disabled successfully.
|
||||
bool disable();
|
||||
|
||||
// TODO: Implement this method if you need to unload the plugin.
|
||||
// /// @return True if the plugin is unloaded successfully.
|
||||
// bool unload();
|
||||
|
||||
Config& getConfig();
|
||||
|
||||
void saveConfig();
|
||||
|
||||
ServerTimeScheduler& getScheduler();
|
||||
|
||||
private:
|
||||
ll::plugin::NativePlugin& mSelf;
|
||||
ll::plugin::NativePlugin& mSelf;
|
||||
std::optional<Config> mConfig;
|
||||
std::optional<ServerTimeScheduler> mScheduler;
|
||||
};
|
||||
|
||||
} // namespace plugin
|
||||
} // namespace Cleaner
|
||||
Reference in New Issue
Block a user