USE AUTOFORMATTING
This commit is contained in:
parent
991dd93650
commit
cbaaed7820
17
main.py
17
main.py
@ -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():
|
||||
@ -153,7 +162,6 @@ def generate_world(tiles_x: int, tiles_y: int) -> World:
|
||||
world.add_entity(Earring(9, 7))
|
||||
world.add_entity(Earring(5, 5))
|
||||
world.add_entity(Earring(4, 6))
|
||||
|
||||
|
||||
for x in range(world.width):
|
||||
for y in range(world.height):
|
||||
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user