Skip to content

Commit 414566d

Browse files
author
tyharwood
committed
Updated comments and changed whitespace mapping on vegmap to string instead of nonetupe
1 parent 5cad3b3 commit 414566d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

owmap/genmap.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,22 @@ def generate_palette(palette, filename):
3636

3737
# Set pixels
3838
for x, color in enumerate(palette.keys()):
39+
# TODO: Add a label for each color in the palette
3940
img.putpixel((x, 0), color)
4041

4142
# Save image
43+
# TODO: Save palette as svg instead of png
4244
img.save(filename)
4345

44-
#TODO: Not amenable to current pipeline, rewrite or impl. process_layer
45-
def interpret_generic(rgb, tilemap, tolerance=25):
46+
#TODO: Rewrite interpret_generic or impl. process_layer
47+
# Not amenable to current pipeline, rewrite or impl. process_layer
48+
def interpret_generic(rgb, tilemap, tolerance=15):
4649
"""
4750
More generic function, not sure if this is the best way to do it.
4851
"""
4952
tiletype = tilemap.get(rgb, "Unknown")
5053

51-
if tiletype != "Unknown" and tiletype != None:
54+
if tiletype != "Unknown" and tiletype != "None":
5255
return tiletype
5356

5457
for center_rgb, tiletype in tilemap.items():
@@ -91,11 +94,11 @@ def interpret_rgb_as_vegetation(rgb):
9194
vegetation_map = {
9295
(0, 255, 0): "VEGETATION_TREES",
9396
(0, 128, 0): "VEGETATION_SCRUB",
94-
(255,255,255): None
97+
(255,255,255): "None"
9598
}
9699
return vegetation_map.get(rgb, "None")
97100

98-
#TODO: Implement
101+
#TODO: Implement process_layer to make it modular
99102
def process_layer():
100103
"""Generic version of loop code in process_map_images"""
101104
...

0 commit comments

Comments
 (0)