From 87ba0c35724a5bc037f669f6186b0f03f09fd44d Mon Sep 17 00:00:00 2001 From: fheinrich <fheinrich@techfak.uni-bielefeld.de> Date: Thu, 7 Dec 2023 17:19:25 +0100 Subject: [PATCH] Added pot in stove constructor, and pot viz --- overcooked_simulator/counters.py | 5 +++++ overcooked_simulator/pygame_gui/pygame_gui.py | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/overcooked_simulator/counters.py b/overcooked_simulator/counters.py index a6f8e2b7..5d6d689f 100644 --- a/overcooked_simulator/counters.py +++ b/overcooked_simulator/counters.py @@ -14,6 +14,7 @@ from overcooked_simulator.game_items import ( ProgressibleItem, Plate, Tomato, + Pot, ) @@ -202,6 +203,10 @@ class Trash(Counter): class Stove(Counter): + def __init__(self, pos: npt.NDArray[float], occupied_by: Optional[Item] = ...): + if occupied_by is ...: + occupied_by = Pot() + super().__init__(pos, occupied_by) def pick_up(self): pass diff --git a/overcooked_simulator/pygame_gui/pygame_gui.py b/overcooked_simulator/pygame_gui/pygame_gui.py index a6c609f1..06858a7d 100644 --- a/overcooked_simulator/pygame_gui/pygame_gui.py +++ b/overcooked_simulator/pygame_gui/pygame_gui.py @@ -13,7 +13,7 @@ from overcooked_simulator.counters import ( ServingWindow, Stove, ) -from overcooked_simulator.game_items import ProgressibleItem, Plate, Item +from overcooked_simulator.game_items import ProgressibleItem, Plate, Item, Pot from overcooked_simulator.game_items import Tomato from overcooked_simulator.overcooked_environment import Action from overcooked_simulator.simulation_runner import Simulator @@ -32,7 +32,7 @@ BACKGROUND_LINES_COLOR = (200, 200, 200) KNIFE_COLOR = (120, 120, 120) PLATE_RETURN_COLOR = (170, 170, 240) BOARD_COLOR = (239, 193, 151) -POT_COLOR = (220, 220, 220) +POT_COLOR = (180, 180, 180) # STOVE_COLOR = (60, 60, 60) # STOVE_HEATING_PLATE_COLOR = (252, 123, 73) @@ -223,7 +223,7 @@ class PyGameGUI: self.draw_item(pos, item.holds) if isinstance(item, Pot): - pot_size = 20 + pot_size = 15 pygame.draw.circle(self.screen, GREY, pos, pot_size) if isinstance(item, ProgressibleItem) and not item.finished: @@ -319,7 +319,6 @@ class PyGameGUI: ) pygame.draw.rect(self.screen, BLACK, stove_rect) pygame.draw.circle(self.screen, RED, center=counter.pos, radius=10) - if counter.occupied_by is not None: if isinstance(counter.occupied_by, list): for i, o in enumerate(counter.occupied_by): -- GitLab