Move common node creation/editing ui to own function, can edit whole node from creation menu

This commit is contained in:
2022-05-12 15:44:09 -05:00
parent 079c4c9004
commit 9f4520e2c5
2 changed files with 54 additions and 40 deletions

View File

@@ -34,6 +34,12 @@ impl Board {
});
}
pub fn insert_node(&mut self, node: Node) -> usize {
let id = self.next_id();
self.nodes.insert(id, node);
id
}
pub fn remove_node(&mut self, id: usize) {
// We remove this node from the graph, then drop it from each
// other nodes edge.