Made component field type ResourceFile easier to work with

This commit is contained in:
WiggleWizard
2024-09-14 09:40:20 +01:00
parent d62f241a16
commit 1e570e17fd
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
#include "FieldTypes.h"
#include "src/FileSystem/File.h"
bool Nuake::ResourceFile::Exist()
{
return file != nullptr && file->Exist();
}
std::string Nuake::ResourceFile::GetRelativePath()
{
if (Exist())
{
return file->GetRelativePath();
}
return "";
}

View File

@@ -12,6 +12,9 @@ namespace Nuake
{
ResourceFile() {}
ResourceFile(const Ref<File>& inFile) : file(inFile) {}
bool Exist();
std::string GetRelativePath();
Ref<File> file = nullptr;
};