//
// Created by sebastian on 30.07.26.
//

#include "Scene.h"

#include <iostream>
#include <ostream>
#include <utility>

#include "core/inputsOutputs/context/InputContextStack.h"

void engine::Scene::onUpdate(float deltaTime) {
    for (const auto& layer : m_layers) {
        layer->onUpdate(deltaTime);
    }
}

void engine::Scene::onRender() {
    for (const auto& layer : m_layers) {
        layer->onRender();
    }
}

void engine::Scene::onRegisterLoadedAsset(LoadedAsset loadedAsset) {
    std::cout << "Loaded asset: "  << std::endl;
    assetManager->insertAsset(std::move(loadedAsset));
}

void engine::Scene::addLayer(std::unique_ptr<Layer> layer) {
    layer->onAttach(m_inputStack);
    m_layers.push_back(std::move(layer));

}
