#pragma once #include "common.hpp" namespace big { class script_local { public: explicit script_local(rage::scrThread* thread, std::size_t index); explicit script_local(PVOID stack, std::size_t index); explicit script_local(std::size_t index); script_local set(rage::scrThread* thread); script_local set(void* stack); script_local at(std::ptrdiff_t index); script_local at(std::ptrdiff_t index, std::size_t size); template std::enable_if_t, T> as() { return static_cast(get()); } template std::enable_if_t, T> as() { return *static_cast>>(get()); } private: void* get(); std::size_t m_index; PVOID m_stack; }; }