package net.halbear.Terrain4J.EngineCore.Main.Scene;

import net.halbear.Terrain4J.EngineCore.Display.Window;
import net.halbear.Terrain4J.EngineCore.Logic.*;
import net.halbear.Terrain4J.EngineCore.Vulkan.Rendering.Projection.Project3D;

import java.util.ArrayList;
import java.util.List;

public class Scene {

    private final List<Actor> Actors;
    private final Project3D Projection;
    private final Camera camera;

    public Scene(Window window) {
        Actors = new ArrayList<>();
        var EngConfig = EngineConfig.getInstance();
        Projection = new Project3D(EngConfig.GetFOV(),EngConfig.GetZNearPlane(), EngConfig.GetZFarPlane(),
                window.getWidth(), window.getHeight());
        camera = new Camera();
    }
    public Camera GetCamera(){return camera;}
    public void AddActor(Actor NewActor){Actors.add(NewActor);}
    public List<Actor> GetActors(){return Actors;}
    public Project3D GetProjection(){return Projection;}
    public void RemoveAllActors(){Actors.clear();}
    public void RemoveActor(Actor actor){Actors.removeIf(Actor->Actor.GetID().equals(actor.GetID()));}
}
