sztuczna_inteligencja_2023_.../garbageCan.py

22 lines
711 B
Python
Raw Normal View History

2023-03-26 14:51:05 +02:00
from garbage import Garbage
from typing import List, Tuple
2023-04-15 19:37:56 +02:00
from gameContext import GameContext
2023-04-22 12:11:06 +02:00
from gridCellType import GridCellType
2023-03-26 14:51:05 +02:00
class GarbageCan:
position: Tuple[int, int]
garbage: List[Garbage]
def __init__(self, position: Tuple[int, int]) -> None:
self.position = position
self.garbage = []
def add_garbage(self, garbage: Garbage) -> None:
self.garbage.append(garbage)
def remove_garbage(self, garbage: Garbage) -> None:
2023-04-15 19:37:56 +02:00
self.garbage.remove(garbage)
def render(self, game_context: GameContext) -> None:
2023-04-22 12:11:06 +02:00
game_context.render_in_cell(self.position, "imgs/container.png")
game_context.grid[self.position] = GridCellType.GARBAGE_CAN