Blocks and flowgraph: added this time

This commit is contained in:
2026-03-11 19:31:37 +01:00
parent 13d060776f
commit 6d99d54f4a
9 changed files with 181 additions and 78 deletions

View File

@ -0,0 +1,28 @@
use crate::block::GraphableBlock;
pub struct FlowGraph
{
blocks: Vec<Box<dyn GraphableBlock + Send + 'static>>,
}
impl FlowGraph
{
pub fn new() -> Self
{
FlowGraph { blocks: vec![] }
}
pub fn add_block<T: GraphableBlock + Send + 'static>(&mut self, block: T)
{
block.set_index(self.blocks.len());
self.blocks.push(Box::new(block));
}
}
impl Default for FlowGraph
{
fn default() -> Self
{
Self::new()
}
}