Files
spice2x-r3d/hooks/develhook.h
T
[ ] 56e8e7456b refactor: Cleanup develhook logic
> refactor hooks::devel to work better with hooks::wmisc
> minor naming consistency changes
2025-12-17 00:00:40 +09:00

26 lines
588 B
C++

#pragma once
#include <cstdint>
#include "util/utils.h"
namespace hooks::devel
{
//_INFO: use attach()/entry_main() to run task before game::attach()/game::entry_main()
class Routine
{
private:
unsigned int hash_;
public:
[[nodiscard]] inline unsigned int constexpr hash() const { return hash_; }
virtual void attach() {}
virtual void entry_main() {}
explicit Routine(const char *name) : hash_(to_hash(name)) {}
virtual ~Routine() = default;
};
Routine *active_routine(const char *name);
void bind_routine(Routine *routine);
void attach();
void entry_main();
}