class _Spans:
Serve a list of 2-tuples (coordinates) which are parts of a span
Grid.spans
property.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 |
Example
grid.spans = _Spans( grid )
Parameters | grid | required Grid object |
Is coordinate (y,x) part of a span ?
if grid.spans.has( y=1, x=2 ) : pass if grid.spans.has(1, 2) : pass
Parameters | y | int y coordinate |
x | int x coordinate | |
Returns | boolean (type: bool ) |
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.
Parameters | y | int y anchor of span |
x | int x anchor of span | |
y_span | int size to y direction | |
x_span | int size to x direction |