Skip to content

Commit 4880f99

Browse files
committed
Use StageLabel trait
1 parent e937ad7 commit 4880f99

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/plugin.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use bevy::{
1616
asset::{Assets, Handle},
1717
ecs::{
1818
query::Added,
19-
schedule::SystemStage,
19+
schedule::{StageLabel, SystemStage},
2020
system::{IntoSystem, Query, ResMut},
2121
},
2222
log::error,
@@ -36,10 +36,11 @@ use tess::{FillOptions, StrokeOptions};
3636
use crate::{entity::ShapeColors, utils::DrawMode};
3737

3838
/// Stages for this plugin.
39-
pub mod stage {
39+
#[derive(Debug, Clone, Eq, Hash, PartialEq, StageLabel)]
40+
pub enum Stage {
4041
/// The stage where the [`ShapeBundle`](crate::entity::ShapeBundle) gets
4142
/// completed.
42-
pub const SHAPE: &str = "shape";
43+
Shape,
4344
}
4445

4546
/// The index type of a Bevy [`Mesh`](bevy::render::mesh::Mesh).
@@ -103,11 +104,11 @@ impl Plugin for ShapePlugin {
103104
.insert_resource(stroke_tess)
104105
.add_stage_after(
105106
bevy::app::CoreStage::Update,
106-
stage::SHAPE,
107+
Stage::Shape,
107108
SystemStage::parallel(),
108109
)
109110
.add_startup_system(crate::render::add_shape_pipeline.system())
110-
.add_system_to_stage(stage::SHAPE, complete_shape_bundle.system());
111+
.add_system_to_stage(Stage::Shape, complete_shape_bundle.system());
111112
}
112113
}
113114

0 commit comments

Comments
 (0)