Move patch getters to srouce

This commit is contained in:
altalk23 2023-09-04 22:39:27 +03:00
parent 69821f3e2c
commit 1eeb8810c9
3 changed files with 16 additions and 9 deletions
loader
include/Geode/loader
src/loader

View file

@ -171,17 +171,13 @@ namespace geode {
* Get the address of the patch.
* @returns Address
*/
uintptr_t getAddress() const {
return reinterpret_cast<uintptr_t>(m_address);
}
uintptr_t getAddress() const;
/**
* Get whether the patch is applied or not.
* @returns True if applied, false if not.
*/
bool isApplied() const {
return m_applied;
}
bool isApplied() const;
bool apply();
bool restore();
@ -190,9 +186,7 @@ namespace geode {
* Get the owner of this patch.
* @returns Pointer to the owner's Mod handle.
*/
Mod* getOwner() const {
return m_owner;
}
Mod* getOwner() const;
/**
* Get info about the patch as JSON

View file

@ -12,6 +12,7 @@ using namespace geode::prelude;
Hook::Hook(std::shared_ptr<Impl>&& impl) : m_impl(std::move(impl)) {}
Hook::~Hook() {}
// These classes (Hook and Patch) are nasty using new and delete, change them in 2.0.0
Hook* Hook::create(
Mod* owner,
void* address,

View file

@ -21,6 +21,18 @@ bool Patch::getAutoEnable() const {
return m_autoEnable;
}
uintptr_t Patch::getAddress() const {
return reinterpret_cast<uintptr_t>(m_address);
}
bool Patch::isApplied() const {
return m_applied;
}
Mod* Patch::getOwner() const {
return m_owner;
}
template <>
struct json::Serialize<ByteVector> {
static json::Value to_json(ByteVector const& bytes) {