use lotus_proc_macros::Component;
use super::{super::color::color::Color, geometry_type::GeometryType, orientation::Orientation};
#[derive(Clone, Debug, Component)]
pub struct Shape {
pub orientation: Orientation,
pub geometry_type: GeometryType,
pub color: Color
}
impl Shape {
pub fn new(orientation: Orientation, geometry_type: GeometryType, color: Color) -> Self {
return Self {
orientation,
geometry_type,
color
};
}
pub fn orientation(&mut self, orientation: Orientation) {
self.orientation = orientation;
}
pub fn geometry_type(&mut self, geometry_type: GeometryType) {
self.geometry_type = geometry_type;
}
pub fn color(&mut self, color: Color) {
self.color = color;
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct Circle {
pub number_of_segments: u16,
pub radius: f32
}
impl Circle {
pub fn new(number_of_segments: u16, radius: f32) -> Self {
return Self {
number_of_segments,
radius
};
}
}
impl Default for Circle {
fn default() -> Self {
return Self {
number_of_segments: 64,
radius: 0.5
};
}
}