Make it possible to create a positioned cell

This commit is contained in:
Weird Constructor 2022-07-11 05:10:46 +02:00
parent 5d784aa8e1
commit cb2baad323

View file

@ -70,10 +70,16 @@ impl Cell {
/// .out(None, Some(0), Some(0)); /// .out(None, Some(0), Some(0));
///``` ///```
pub fn empty(node_id: NodeId) -> Self { 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 { Self {
node_id, node_id,
x: 0, x,
y: 0, y,
out1: None, out1: None,
out2: None, out2: None,
out3: None, out3: None,