findNode method
Implementation
FindNodeResult? findNode(bool Function(NodeOutput) f) {
FindNodeResult? result;
this.s.asMap().entries.any((rowEntry) {
var y = rowEntry.key;
var row = rowEntry.value;
return row.asMap().entries.any((columnEntry) {
var x = columnEntry.key;
var cell = columnEntry.value;
if (cell == null) return false;
if (f(cell)) {
result = FindNodeResult(coords: [x, y], item: cell);
return true;
}
return false;
});
});
return result;
}