use macroquad::prelude::*;

pub struct RamDisplay {}

impl RamDisplay {
    pub fn render(ram: &Box<[u8]>, x_offset: f32, y_offset: f32) {
        Self::draw_square(
            x_offset,
            y_offset,
            x_offset + 200.0,
            y_offset + 300.0,
            BLACK,
        );

        draw_text("RAM", x_offset + 5.0, y_offset + 5.0, 15.0, BLACK);
    }

    fn draw_square(x1: f32, y1: f32, x2: f32, y2: f32, color: Color) {
        // println!("Square from {x1:2.0}x{y1:2.0} to {x2:2.0}x{y2:2.0} with {:?}", color);
        draw_line(x1, y1, x2, y1, 1.0, color);
        draw_line(x1, y1, x1, y2, 1.0, color);
        draw_line(x1, y2, x2, y2, 1.0, color);
        draw_line(x2, y1, x2, y2, 1.0, color);
    }
}
