class documentation

class _Spans:

View In Hierarchy

Serve a list of 2-tuples (coordinates) which are parts of a span

Method __init__ Example
Instance Variable grid Grid object
Method has Is coordinate (y,x) part of a span ?
Method reserve Store 2-tuples as coordinates to property _list, belonging to a span
Instance Variable _list List of 2-tuple cell coordinates (y,x) which are parts of any span
def __init__(self, grid=None):

Example

grid.spans = _Spans( grid )
Parametersgridrequired Grid object
grid =
Grid object
_list =
List of 2-tuple cell coordinates (y,x) which are parts of any span
(type: list)
def has(self, y=0, x=0):

Is coordinate (y,x) part of a span ?

if grid.spans.has( y=1, x=2 ) : pass
if grid.spans.has(1, 2)       : pass
Parametersyint y coordinate
xint x coordinate
Returnsboolean (type: bool)
def reserve(self, y=None, x=None, y_span=None, x_span=None):

Store 2-tuples as coordinates to property _list, belonging to a span

grid.spans.reserve( y=0, x=1, y_span=2, x_span=2 )
grid.spans.reserve(0,1, y_span=2, x_span=2)

Mark cells belonging to a span by adding tuples of (y,x) coordinates to property _list.

Parametersyint y anchor of span
xint x anchor of span
y_spanint size to y direction
x_spanint size to x direction
API Documentation for gtgrid, generated by pydoctor 21.2.2 at 2021-06-12 11:12:41.