paiagram_core/
interval.rs1use bevy::{ecs::query::QueryData, prelude::*};
2
3use crate::units::distance::Distance;
4
5#[derive(Reflect, Component)]
7#[reflect(Component)]
8pub struct Interval {
9 pub length: Distance,
10}
11
12#[derive(QueryData)]
13pub struct IntervalQuery {
14 distance: &'static Interval,
15}
16
17impl<'w, 's> IntervalQueryItem<'w, 's> {
18 pub fn distance(&self) -> Distance {
19 self.distance.length
20 }
21}
22
23#[derive(EntityEvent)]
24pub struct UpdateInterval {
25 pub entity: Entity,
26 pub source: Entity,
27 pub target: Entity,
28}