mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Made component field type ResourceFile easier to work with
This commit is contained in:
18
Nuake/src/Scene/Components/FieldTypes.cpp
Normal file
18
Nuake/src/Scene/Components/FieldTypes.cpp
Normal 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 "";
|
||||
}
|
||||
@@ -12,6 +12,9 @@ namespace Nuake
|
||||
{
|
||||
ResourceFile() {}
|
||||
ResourceFile(const Ref<File>& inFile) : file(inFile) {}
|
||||
|
||||
bool Exist();
|
||||
std::string GetRelativePath();
|
||||
|
||||
Ref<File> file = nullptr;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user