#ifndef NONUT_CORE_CLASS_H #define NONUT_CORE_CLASS_H #include "CommonHeader.h" #include #include "Function.h" // ReSharper disable once CppUnusedIncludeDirective #include "Property.h" #include "Instance.h" #define METHOD_CTOR(methodName) methodName(#methodName, this->classObjectInstance, this->classObject) #define PROPERTY_CTOR(propertyName) propertyName(#propertyName, this->classObjectInstance) #define COPY_CTOR(type) type(const type& other) : type(other.getInstance()){} \ type& operator=(const type& other) = delete namespace nonut { static constexpr auto CONSTRUCTOR_NAME = "constructor"; class Class : public Instance { public: Class(const String& className, SQObject classObjectInstance = SQ_NULL); virtual ~Class(); [[nodiscard]] SQObject getInstance() const override; bool isNull() const; protected: // Object holding information about class SQObject classObject{}; // Class object instance SQObject classObjectInstance{}; template void classCtor(Args ... args) { Function ctor(CONSTRUCTOR_NAME, classObjectInstance, classObject); ctor(std::forward(args)...); } bool bIsNull = false; }; } #endif // NONUT_CORE_CLASS_H