Asset.h 905 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <Atomic/Core/Object.h>
  3. #include "AssetImporter.h"
  4. using namespace Atomic;
  5. namespace ToolCore
  6. {
  7. class Asset : public Object
  8. {
  9. OBJECT(Asset);
  10. public:
  11. /// Construct.
  12. Asset(Context* context, const String& guid, unsigned timestamp);
  13. virtual ~Asset();
  14. bool Import();
  15. const String& GetGUID() const { return guid_; }
  16. const String& GetImporterName() { return importer_.Null() ? String::EMPTY : importer_->GetTypeName(); }
  17. const String& GetName() { return name_; }
  18. const String& GetPath() const { return path_; }
  19. bool SetPath(const String& path);
  20. void SetDirty(bool dirty) { dirty_ = dirty; }
  21. bool IsDirty() const { return dirty_; }
  22. bool IsFolder() const { return isFolder_; }
  23. private:
  24. String guid_;
  25. String path_;
  26. String name_;
  27. bool dirty_;
  28. bool isFolder_;
  29. SharedPtr<AssetImporter> importer_;
  30. };
  31. }