From cb2baad32316c97f4fd89a9c514beb3196c59b3e Mon Sep 17 00:00:00 2001 From: Weird Constructor Date: Mon, 11 Jul 2022 05:10:46 +0200 Subject: [PATCH] Make it possible to create a positioned cell --- src/matrix.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index 64c66c0..1279179 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -70,10 +70,16 @@ impl Cell { /// .out(None, Some(0), Some(0)); ///``` pub fn empty(node_id: NodeId) -> Self { + Self::empty_at(node_id, 0, 0) + } + + /// This is an alternative constructor, in case you know the position of the + /// cell before you got it from the Matrix. + pub fn empty_at(node_id: NodeId, x: u8, y: u8) -> Self { Self { node_id, - x: 0, - y: 0, + x, + y, out1: None, out2: None, out3: None,