USE AUTOFORMATTING

This commit is contained in:
Mateusz Dokowicz 2023-05-25 16:26:13 +02:00
parent 991dd93650
commit cbaaed7820

17
main.py
View File

@ -13,6 +13,7 @@ from domain.entities.earring import Earring
from domain.entities.docking_station import Doc_Station
from domain.world import World
from view.renderer import Renderer
# from AI_brain.movement import GoAnyDirectionBFS, State
# from AI_brain.rotate_and_go_bfs import RotateAndGoBFS, State
from AI_brain.rotate_and_go_astar import RotateAndGoAStar, State
@ -97,12 +98,20 @@ class Main:
def handle_action2(self, action):
if action == "GO":
self.commands.append(
VacuumMoveCommand(self.world, self.world.vacuum, self.world.vacuum.direction)
VacuumMoveCommand(
self.world, self.world.vacuum, self.world.vacuum.direction
)
)
elif action == "RR":
self.world.vacuum.direction = (-self.world.vacuum.direction[1], self.world.vacuum.direction[0])
self.world.vacuum.direction = (
-self.world.vacuum.direction[1],
self.world.vacuum.direction[0],
)
elif action == "RL":
self.world.vacuum.direction = (self.world.vacuum.direction[1], -self.world.vacuum.direction[0])
self.world.vacuum.direction = (
self.world.vacuum.direction[1],
-self.world.vacuum.direction[0],
)
def process_input(self):
for event in pygame.event.get():
@ -154,7 +163,6 @@ def generate_world(tiles_x: int, tiles_y: int) -> World:
world.add_entity(Earring(5, 5))
world.add_entity(Earring(4, 6))
for x in range(world.width):
for y in range(world.height):
if world.is_garbage_at(x, y):
@ -163,6 +171,7 @@ def generate_world(tiles_x: int, tiles_y: int) -> World:
world.costs[x][y] = 10
return world
if __name__ == "__main__":
app = Main()
if config["APP"]["movement"] == "human":