> refactor hooks::devel to work better with hooks::wmisc > minor naming consistency changes
26 lines
588 B
C++
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();
|
|
}
|