Skip to main content

euv_engine/scene/
struct.rs

1use super::*;
2
3/// Manages scene registration, transitions, and lifecycle.
4#[derive(Clone, Data, New)]
5pub struct SceneManager {
6    /// All registered scenes keyed by name.
7    #[get_mut(pub(crate))]
8    #[set(pub(crate))]
9    #[new(skip)]
10    pub(crate) scenes: HashMap<String, SceneRc>,
11    /// The name of the currently active scene, if any.
12    #[get_mut(pub(crate))]
13    #[set(pub(crate))]
14    #[new(skip)]
15    pub(crate) current_scene_name: Option<String>,
16    /// The name of the next scene to switch to (for deferred transitions).
17    #[get_mut(pub(crate))]
18    #[set(pub(crate))]
19    #[new(skip)]
20    #[get(pub(crate))]
21    pub(crate) pending_scene_name: Option<String>,
22    /// The reusable per-frame draw list. Cleared and refilled each render call
23    /// so the backing `Vec` capacity is reused across frames.
24    #[get_mut(pub(crate))]
25    #[set(pub(crate))]
26    #[new(skip)]
27    #[get(pub(crate))]
28    pub(crate) draw_list: DrawList,
29}