//
// Created by sebastian on 08.02.26.
//

#include "AssetManager.h"

#include <cassert>

#include "../loader/OBJLoader.h"


std::shared_ptr<TexturedModel> AssetManager::loadModel(const std::string &name, const std::string &objPath,  const std::string &texturePath, Loader &loader) {
    if (models.contains(name)) {
        return models[name];
    }

    auto model = OBJLoader::loadModel(objPath, texturePath, loader);
    models[name] = model;
    return model;
}

std::shared_ptr<TexturedModel> AssetManager::getModel(const std::string &name) {
    assert(models.contains(name) && "Model not found!");
    return models.at(name);
}
