/******************************************************************************
*	File		-	editor_asset.h
*	Author		-	Joey Pollack
*	Date		-	2022/02/22 (y/m/d)
*	Mod Date	-	2022/02/22 (y/m/d)
*	Description	-	Editor assets base class
******************************************************************************/

#ifndef EDITOR_ASSETS_H_
#define EDITOR_ASSETS_H_

#include "definitions.h"
#include <core/common_defs.h>
#include "content_manager.h"
#include <utils/op_res.h>
#include <assets/serializing/json_serializable.h>
#include <filesystem>
#include <string>

namespace lunarium { namespace editor 
{

    class EditorAsset : public JSONSerializable
    {
    public:
        EditorAsset(AssetType type);

        AssetType GetType();
        LUUID GetID();
        std::filesystem::path GetFileLocation();
        bool GetIsTrashed() const;

        [[nodiscard]] virtual OpRes LoadRawFile() = 0;

        /// @return returns true if the properties were updated
        virtual bool DrawProperties() = 0;


       // [[nodiscard]] virtual OpRes LoadFromJSON(nlohmann::json& node) = 0;
        //[[nodiscard]] virtual OpRes SaveToJSON(nlohmann::json& node) = 0;

    private:
        friend class ContentManager;
        AssetType mType;
        LUUID mID;
        bool mIsTrashed;

    protected:
        std::filesystem::path mLocation;

    protected:
        std::filesystem::path mAssetDir;
      //  [[nodiscord]] virtual bool IsValidNode(nlohmann::json& node) = 0;

    private: // DISABLE COPY
        EditorAsset(const EditorAsset&) = delete;
        EditorAsset& operator=(const EditorAsset&) = delete;
    };
}}

#endif  // EDITOR_ASSETS_H_