pite_core/lifecycle.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2use crate::node::NodeId;
3
4/// Lifecycle dispatch seam (`_ready`, `_process`, `_draw`).
5///
6/// Systems call into scripts through this sink; missing methods are
7/// no-ops, never errors.
8pub trait LifecycleSink {
9 fn on_ready(&mut self, _node: &NodeId) {}
10 fn on_process(&mut self, _node: &NodeId, _delta: f32) {}
11}
12
13/// No-op sink for headless use and tests; the script backend replaces it.
14#[allow(dead_code)]
15#[derive(Debug, Default)]
16pub struct NoopSink;
17
18impl LifecycleSink for NoopSink {}