mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
custom supplydrops and battlebus based on version
This commit is contained in:
63
Project Reboot 3.0/TSubclassOf.h
Normal file
63
Project Reboot 3.0/TSubclassOf.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
template<typename ClassType>
|
||||
class TSubclassOf
|
||||
{
|
||||
class UClass* ClassPtr;
|
||||
|
||||
public:
|
||||
TSubclassOf() = default;
|
||||
|
||||
inline TSubclassOf(UClass* Class)
|
||||
: ClassPtr(Class)
|
||||
{
|
||||
}
|
||||
|
||||
inline UClass* Get()
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline operator UClass* () const
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
template<typename Target, typename = std::enable_if<std::is_base_of_v<Target, ClassType>, bool>::type>
|
||||
inline operator TSubclassOf<Target>() const
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline UClass* operator->()
|
||||
{
|
||||
return ClassPtr;
|
||||
}
|
||||
|
||||
inline TSubclassOf& operator=(UClass* Class)
|
||||
{
|
||||
ClassPtr = Class;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator==(const TSubclassOf& Other) const
|
||||
{
|
||||
return ClassPtr == Other.ClassPtr;
|
||||
}
|
||||
|
||||
inline bool operator!=(const TSubclassOf& Other) const
|
||||
{
|
||||
return ClassPtr != Other.ClassPtr;
|
||||
}
|
||||
|
||||
inline bool operator==(UClass* Other) const
|
||||
{
|
||||
return ClassPtr == Other;
|
||||
}
|
||||
|
||||
inline bool operator!=(UClass* Other) const
|
||||
{
|
||||
return ClassPtr != Other;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user