#pragma once #include namespace WallpaperEngine::Core::Projects { using json = nlohmann::json; class CPropertyColor; class CProperty { public: static CProperty* fromJSON (json data, const std::string& name); template const T As () const { assert (Is ()); return (const T*) this; } template T As () { assert (Is ()); return (T*) this; } template bool Is () { return this->m_type == T::Type; } std::string& getName (); std::string& getType (); std::string& getText (); protected: CProperty (std::string name, std::string type, std::string text); std::string m_type; std::string m_name; std::string m_text; }; }