canMerge method
- VectorDefinition start,
- CellMergeDirection direction,
- int span
Implementation
bool canMerge(
VectorDefinition start,
CellMergeDirection direction,
int span,
) {
var current = start;
for (var i = 0; i < span; i++) {
if (!containsCell(current)) return false;
current = direction == CellMergeDirection.horizontal
? VectorDefinition(current.x + 1, current.y)
: VectorDefinition(current.x, current.y + 1);
}
return true;
}