build structure function (working ish?) and develop society to test it

This commit is contained in:
Thefeli73 2020-10-04 03:17:11 +02:00
parent 942dc02331
commit 0918549cfb

29
main.py
View File

@ -168,7 +168,36 @@ def something_needs_attention():
pass
def develop_society():
#state = game_layer.game_state
if len(game_layer.game_state.residences) < 1:
build("Apartments")
elif False:
pass
else:
game_layer.wait()
def build(structure):
print("Building " + structure)
state = game_layer.game_state
global building_under_construction
for i in range(len(availableTiles)):
if isinstance(availableTiles[i], tuple):
game_layer.place_foundation(availableTiles[i], structure)
for j in range(len(state.residences)):
building = state.residences[j]
coords_to_check = (building.X, building.Y)
if coords_to_check == availableTiles[i]:
availableTiles[i] = building
building_under_construction = (building.X,building.Y)
return True
for j in range(len(state.utilities)):
building = state.utilities[j]
coords_to_check = (building.X, building.Y)
if coords_to_check == availableTiles[i]:
availableTiles[i] = building
building_under_construction = (building.X,building.Y)
return True
if __name__ == "__main__":
main()