@@ -20,7 +20,7 @@ class Area():
2020 A minimalist collection of Area-plotted Glyphs.
2121 Area numbers are 1's based.
2222 Area plotting is 0's based.
23- Names are Trekian.
23+ Area names are Trekian.
2424 '''
2525 class Piece :
2626 '''
@@ -37,7 +37,6 @@ def __init__(self):
3737 '''
3838 self .name = ""
3939 self .number = - 1
40- self .scanned = False
4140 self ._pieces = []
4241
4342 def is_null (self ):
@@ -47,15 +46,14 @@ def is_null(self):
4746 dum = Area ()
4847 return dum .name == self .name and \
4948 dum .number == self .number and \
50- dum .scanned == self .scanned and \
5149 len (dum .objs ) == len (self ._pieces )
5250
5351 def is_empty (self ):
5452 ''' Checks to see if the Area has anything ...'''
5553 return len (self ._pieces ) == True
5654
57- def items (self ):
58- ''' Items in the Area ...'''
55+ def item_count (self )-> int :
56+ ''' The number of pieces / items in the randint ...'''
5957 return len (self ._pieces )
6058
6159 def remove (self , xpos , ypos ):
@@ -67,7 +65,7 @@ def remove(self, xpos, ypos):
6765
6866 def get_map (self )-> list :
6967 '''
70- Generate a map of this AREA . Map is full
68+ Generate a map of this randint . Map is full
7169 of Glyphs.SPACE on error.
7270 '''
7371 results = [[Glyphs .SPACE for _ in range (8 )] for _ in range (8 )]
@@ -89,7 +87,12 @@ def range_ok(self, xpos, ypos):
8987 return False
9088 return True
9189
92- def get_data (self , glyph ):
90+ def query (self , glyph ):
91+ '''
92+ Clone each Piece for a glyph into a new
93+ collection. Changes to the results WILL NOT
94+ affect the glyph in the AREA.
95+ '''
9396 results = []
9497 for p in self ._pieces :
9598 if p .glyph == glyph :
@@ -140,10 +143,17 @@ def clone(piece):
140143 return SparseMap .Area .Piece (piece .xpos , piece .ypos , piece .glyph )
141144
142145 def __init__ (self ):
146+ '''
147+ Create the uninitialized REGION. Use .init() to
148+ populate same with AREAs.
149+ '''
143150 self .initalized = False
144151 self ._map = [[[y ,x ] for y in range (8 )] for x in range (8 )]
145152
146153 def init (self , reset = False ):
154+ '''
155+ Fill a newly-created map with a set of randomly-named AREAs.
156+ '''
147157 if not reset and self .initalized :
148158 return
149159 for xx , row in enumerate (self ._map ):
0 commit comments