Temp-Classes/base/fwExtensibleBase.hpp
Yimura d81f392e61 Script VM classes (#60)
* feat(Script): Ported BBv2 script classes
* fix: Change hard tab indents to 4 width space indents
2022-11-08 21:11:50 +00:00

32 lines
747 B
C++

#pragma once
#include <typeinfo>
#include "fwRefAwareBase.hpp"
#include "fwExtensionContainer.hpp"
#include "../rage/joaat.hpp"
namespace rage
{
class fwExtensibleBase : public fwRefAwareBase
{
public:
virtual bool is_of_type(std::uint32_t hash) = 0;
virtual uint32_t const &get_type() = 0;
fwExtensionContainer* m_extension_container; // 0x0010
void *m_extensible_unk; // 0x0018
template <typename T>
bool is_of_type()
{
static auto name = (typeid(T).name()) + 6; // Skip "class "
static auto name_hash = joaat(name);
return is_of_type(name_hash);
}
}; //Size: 0x0020
static_assert(sizeof(fwExtensibleBase) == 0x20);
}