use nightshade::ecs::scene::Scene;

#[derive(Default)]
pub struct ProjectState {
    pub scene: Scene,
    pub scene_name: String,
    #[cfg(not(target_arch = "wasm32"))]
    pub current_path: Option<std::path::PathBuf>,
    pub modified: bool,
}

impl ProjectState {
    pub fn new(scene_name: impl Into<String>) -> Self {
        let scene_name = scene_name.into();
        Self {
            scene: Scene::new(&scene_name),
            scene_name,
            #[cfg(not(target_arch = "wasm32"))]
            current_path: None,
            modified: false,
        }
    }

    pub fn mark_modified(&mut self) {
        self.modified = true;
    }

    pub fn clear_modified(&mut self) {
        self.modified = false;
    }
}
