2022-06-03 14:27:35 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace rage
|
|
|
|
{
|
|
|
|
template <typename T>
|
2022-11-08 22:11:50 +01:00
|
|
|
struct atSingleton
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
T* m_basePtr{};
|
2022-06-03 14:27:35 +02:00
|
|
|
|
2022-11-08 22:11:50 +01:00
|
|
|
public:
|
|
|
|
bool isValid() const
|
|
|
|
{
|
|
|
|
return m_basePtr != nullptr;
|
|
|
|
}
|
2022-06-03 14:27:35 +02:00
|
|
|
|
2022-11-08 22:11:50 +01:00
|
|
|
T* getInstance()
|
|
|
|
{
|
|
|
|
return m_basePtr;
|
|
|
|
}
|
|
|
|
};
|
2022-06-03 14:27:35 +02:00
|
|
|
}
|