enclosures property
int
get
enclosures
Gets the number of enclosed regions in the matrix.
An enclosed region is a contiguous area of false cells completely surrounded by true cells. This getter calculates the number of such regions in the matrix.
The calculation is performed only once and the result is cached for subsequent calls to improve performance.
Returns: An integer representing the number of enclosed regions in the matrix.
Note: The actual counting is performed by the countEnclosedRegion
function, which is assumed to be defined elsewhere in the class or
imported from another file.
Implementation
int get enclosures {
if (_enclosures == -1) {
_enclosures = _countEnclosedRegion(this);
}
return _enclosures;
}