paiagram/
lines.rs

1use crate::basic::*;
2use bevy::prelude::*;
3
4/// Displayed line type:
5/// A list of (station entity, size of the interval on canvas in mm)
6/// The first entry is the starting station, where the canvas distance is simply omitted.
7/// Each entry afterwards represents the interval from the previous station to this station.
8pub type DisplayedLineType = Vec<(Entity, CanvasDistance)>;
9
10pub type RulerLineType = Vec<(Entity, TimetableTime)>;
11
12/// An imaginary (railway) line on the canvas, consisting of multiple segments.
13#[derive(Component, Reflect, Debug)]
14#[require(Name)]
15pub struct DisplayedLine(pub DisplayedLineType);
16
17#[derive(Component, Reflect, Debug)]
18#[require(Name)]
19pub struct RulerLine(pub RulerLineType);