Added Mountain building

This commit is contained in:
NichiHachi
2024-06-15 17:13:46 +02:00
parent a78558a988
commit 8195396a04
21 changed files with 128 additions and 24 deletions

View File

@@ -3,6 +3,7 @@ from typing import Union
from random import randint
from PIL import Image
class Road:
def __init__(self, position: Position, id_height: int, id_width: int, border: bool = False):
self.position: Position = position
@@ -58,7 +59,7 @@ class District:
return (0 <= point_new.x < len(map_data[0]) and
0 <= point_new.y < len(map_data) and
map_data[point_new.y][point_new.x] == 0 and
(self.type == "Mountain" or
(self.type == "mountain" or
abs(height_map[point_new.y][point_new.x] - height_map[point.y][point.x]) < 2))
def is_point_inside(self, point: Position, map_data) -> bool: