2020-05-05 01:51:13 +02:00
|
|
|
#pragma once
|
|
|
|
|
#include "MinimalEngine.h"
|
2023-02-13 14:56:13 +01:00
|
|
|
#include "Serialization/ArchiveBuffer.h"
|
2020-05-05 01:51:13 +02:00
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
2023-01-29 18:58:59 +01:00
|
|
|
DECLARE_NAME_REF(Gfx, Graphics)
|
2020-05-05 01:51:13 +02:00
|
|
|
class Asset
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-06-02 11:46:18 +02:00
|
|
|
enum class Status
|
|
|
|
|
{
|
|
|
|
|
Uninitialized,
|
|
|
|
|
Loading,
|
|
|
|
|
Ready
|
|
|
|
|
};
|
2020-05-05 01:51:13 +02:00
|
|
|
Asset();
|
2023-02-13 14:56:13 +01:00
|
|
|
Asset(std::string_view folderPath, std::string_view name);
|
2020-05-05 01:51:13 +02:00
|
|
|
virtual ~Asset();
|
2020-06-08 01:44:47 +02:00
|
|
|
|
2023-02-24 22:09:07 +01:00
|
|
|
void updateByteSize();
|
|
|
|
|
|
2023-02-13 14:56:13 +01:00
|
|
|
virtual void save(ArchiveBuffer& buffer) const = 0;
|
|
|
|
|
virtual void load(ArchiveBuffer& buffer) = 0;
|
2020-06-02 11:46:18 +02:00
|
|
|
|
2023-07-31 21:43:20 +02:00
|
|
|
bool isModified() const;
|
2023-02-13 14:56:13 +01:00
|
|
|
// returns the assets name
|
|
|
|
|
std::string getName() const;
|
|
|
|
|
// returns the (virtual) folder path
|
|
|
|
|
std::string getFolderPath() const;
|
|
|
|
|
// returns the identifier with which it can be found from the asset registry
|
|
|
|
|
std::string getAssetIdentifier() const;
|
|
|
|
|
|
|
|
|
|
constexpr Status getStatus()
|
2020-06-02 11:46:18 +02:00
|
|
|
{
|
|
|
|
|
return status;
|
|
|
|
|
}
|
2023-02-13 14:56:13 +01:00
|
|
|
constexpr void setStatus(Status _status)
|
2020-06-02 11:46:18 +02:00
|
|
|
{
|
2022-11-15 12:19:11 +01:00
|
|
|
status = _status;
|
2020-06-02 11:46:18 +02:00
|
|
|
}
|
|
|
|
|
protected:
|
2023-02-13 14:56:13 +01:00
|
|
|
std::string folderPath;
|
|
|
|
|
std::string name;
|
|
|
|
|
std::string assetId;
|
2021-04-01 16:40:14 +02:00
|
|
|
Status status;
|
2023-02-24 22:09:07 +01:00
|
|
|
uint64 byteSize;
|
2020-05-05 01:51:13 +02:00
|
|
|
};
|
2021-04-01 16:40:14 +02:00
|
|
|
DEFINE_REF(Asset)
|
2020-05-05 01:51:13 +02:00
|
|
|
} // namespace Seele
|