VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
ScriptBindings.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <functional>
5#include <string_view>
6
7namespace VoltMod
8{
9
10/** What a VScript binding calls: a function, or the vtable index a virtual binding dispatches through. */
12{
13 void* Address = nullptr;
14 int Index = -1;
15};
16
17/** Finds VScript binding @p name on the class with vtable @p classTable or on its bases. Injected
18 * so the resolver stays SDK-free. */
19using ScriptBindingLookup = std::function<Result<ScriptTarget>(void* classTable, std::string_view name)>;
20
21/** The @ref ScriptBindingLookup the host uses. */
22Result<ScriptTarget> FindScriptBinding(void* classTable, std::string_view name);
23
24} // namespace VoltMod
std::function< Result< ScriptTarget >(void *classTable, std::string_view name)> ScriptBindingLookup
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
Result< ScriptTarget > FindScriptBinding(void *classTable, std::string_view name)
std::expected< T, Error > Result
Definition Result.hpp:64