Implement a function for drawing components

This commit is contained in:
Manuel Thalmann 2025-04-11 19:52:57 +02:00
parent a9e2f628ad
commit 2a7c035a42
Signed by: manuth
SSH key fingerprint: SHA256:HsMLC+7kJWALP6YCYCoopxNbUnghwSGLVcG76SECT5c

View file

@ -2,6 +2,14 @@ pub struct Screen {
pub components: Vec<Box<dyn Draw>>,
}
impl Screen {
pub fn run(&self) {
for component in self.components.iter() {
component.draw();
}
}
}
pub trait Draw {
fn draw(&self);
}