From 7ccc460a99bdd6299af9fc95d246826715092df1 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Mon, 27 Nov 2023 13:45:48 +0200 Subject: Added the intial design of the logic gate simulator --- src/input_layout.rs | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/input_layout.rs (limited to 'src/input_layout.rs') diff --git a/src/input_layout.rs b/src/input_layout.rs deleted file mode 100644 index 2b086a3..0000000 --- a/src/input_layout.rs +++ /dev/null @@ -1,25 +0,0 @@ -use crate::gate::*; -use macroquad::prelude::*; - -pub struct InputLayout { - inputs: Vec, -} - -impl InputLayout { - pub fn new(inputs: Vec) -> Self { - InputLayout { inputs } - } - pub fn draw(&self) { - let playground_offset_x: f32 = screen_width() / 20.; - let playground_offset_y: f32 = screen_height() / 14.; - let playground_height: f32 = screen_height() - playground_offset_y * 2.0; - for (cnt, node) in self.inputs.iter().enumerate() { - draw_circle( - playground_offset_x, - playground_height / 3.0 + 25. + (30. * cnt as f32), - node.radius, - if node.on { node.color } else { GRAY }, - ); - } - } -} -- cgit v1.2.3