use bevy_prototype_lyon::prelude::PathBuilder; use crate::{ datatypes::{ angle::{Angle, AngleUnit}, length::Length, Coordinate, }, turtle::Precision, }; /** * All the possibilities to draw something with turtle. All the commands can get the position, heading, * color and fill_color from the turtles state. */ pub enum MoveCommand { Forward(Length), Backward(Length), Circle { radius: Length, angle: Angle }, Goto(Coordinate), Home, } /// Different ways to drop breadcrumbs on the way like a dot or a stamp of the turtles shape. pub enum Breadcrumb { Dot, Stamp, } /// Different ways that change the orientation of the turtle. pub enum OrientationCommand { Left(Angle), Right(Angle), SetHeading, LookAt(Coordinate), } /// A combination of all commands that can be used while drawing. pub enum DrawElement { Draw(MoveCommand), Move(MoveCommand), Orient(OrientationCommand), Drip(Breadcrumb), } pub enum DrawingSegment { Single(DrawElement), Outline(Vec), Filled(Vec), } impl DrawingSegment { pub fn draw(&self) { match self { DrawingSegment::Single(elem) => { let mut path_builder = PathBuilder::new(); } DrawingSegment::Outline(_) => todo!(), DrawingSegment::Filled(_) => todo!(), } } } #[derive(PartialEq, Eq)] pub enum DrawState { PenDown, PenUp, }