SI_projekt_smieciarka/pool.py

14 lines
528 B
Python
Raw Normal View History

2021-06-23 11:40:06 +02:00
class Pool:
def __init__(self, position, grid_size):
self.pos = position
self.size = grid_size
def create_pools(grid_size):
pools = []
with open(file='houses.txt', mode='r', encoding='utf-8') as file:
for l_index, line in enumerate(file):
for h_index, if_house in enumerate(line):
if if_house == '2':
pool = Pool(
[h_index*grid_size, l_index*grid_size], grid_size)
pools.append(pool)
return pools