1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! Bevy Component surface for upstream `symbios-shape` occlusion labels.
//!
//! A grammar stamps an occlusion class on a branch with `Label("chimneys")`;
//! the interpreter carries it to every terminal derived beneath, where the
//! `If*` conditionals use it to filter their spatial tests. This module
//! mirrors that class into the ECS as [`TerminalLabel`], so gameplay,
//! picking, and debug-draw systems can select the same groups the grammar
//! reasoned about.
//!
//! ```ignore
//! // Grammar: Roof --> Label("roof") I("Tile")
//! fn highlight_roofs(q: Query<(Entity, &TerminalLabel)>) {
//! for (e, label) in &q {
//! if label.is("roof") { /* … */ }
//! }
//! }
//! ```
use Component;
/// The occlusion class a terminal was stamped with by `Label("…")`.
///
/// Inserted by [`SpawnShapeExt::spawn_shape`] onto every spawned terminal
/// whose upstream [`Terminal::label`] is `Some`. Terminals from unlabelled
/// branches carry no component at all, so `Query<&TerminalLabel>` naturally
/// iterates only the classified ones.
///
/// [`SpawnShapeExt::spawn_shape`]: crate::spawner::SpawnShapeExt::spawn_shape
/// [`Terminal::label`]: symbios_shape::Terminal
;