2022-08-21 01:17:32 +08:00
|
|
|
#pragma once
|
2022-08-26 04:06:34 +08:00
|
|
|
#include <typeinfo>
|
2022-08-21 01:17:32 +08:00
|
|
|
|
|
|
|
#include "fwRefAwareBase.hpp"
|
|
|
|
#include "fwExtensionContainer.hpp"
|
|
|
|
|
2022-08-26 04:06:34 +08:00
|
|
|
#include "../rage/joaat.hpp"
|
|
|
|
|
2022-08-21 01:17:32 +08:00
|
|
|
namespace rage
|
|
|
|
{
|
|
|
|
class fwExtensibleBase : public fwRefAwareBase
|
2022-11-09 05:11:50 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual bool is_of_type(std::uint32_t hash) = 0;
|
|
|
|
virtual uint32_t const &get_type() = 0;
|
2022-08-21 01:17:32 +08:00
|
|
|
|
2022-11-09 05:11:50 +08:00
|
|
|
fwExtensionContainer* m_extension_container; // 0x0010
|
|
|
|
void *m_extensible_unk; // 0x0018
|
2022-08-21 01:17:32 +08:00
|
|
|
|
2022-11-09 05:11:50 +08:00
|
|
|
template <typename T>
|
|
|
|
bool is_of_type()
|
|
|
|
{
|
|
|
|
static auto name = (typeid(T).name()) + 6; // Skip "class "
|
|
|
|
static auto name_hash = joaat(name);
|
2022-08-21 01:17:32 +08:00
|
|
|
|
2022-11-09 05:11:50 +08:00
|
|
|
return is_of_type(name_hash);
|
|
|
|
}
|
|
|
|
}; //Size: 0x0020
|
2022-08-21 01:17:32 +08:00
|
|
|
static_assert(sizeof(fwExtensibleBase) == 0x20);
|
|
|
|
|
2022-08-26 04:06:34 +08:00
|
|
|
}
|