Nothing goes right in its time

This commit is contained in:
Rendo 2025-11-06 21:35:19 +05:00
commit 17cadfe2fd
4 changed files with 146 additions and 16 deletions

View file

@ -1,12 +0,0 @@
use crate::node::Node;
pub struct GraphModifier<'a> {
root: &'a Node,
}
impl<'a> GraphModifier<'a> {
pub fn new(root: &Node) -> GraphModifier {
GraphModifier { root }
}
}

View file

@ -1,6 +1,6 @@
use crate::node::graph_modifier::GraphModifier;
use crate::node::node_modifier::NodeModifier;
mod graph_modifier;
mod node_modifier;
pub struct Node {
children: Vec<Node>,
@ -31,7 +31,7 @@ impl Node {
return (self.function)(inputs);
}
pub fn modify_tree(&self) -> GraphModifier {
GraphModifier::new(self)
pub fn modify_tree<'a>(&'a mut self) -> NodeModifier<'a> {
NodeModifier::from_random(self)
}
}