24 lines
764 B
Python
24 lines
764 B
Python
from garbage import Garbage
|
|
from typing import List, Tuple
|
|
from gameContext import GameContext
|
|
from gridCellType import GridCellType
|
|
|
|
class GarbageCan:
|
|
position: Tuple[int, int]
|
|
garbage: List[Garbage]
|
|
is_visited: bool
|
|
|
|
def __init__(self, position: Tuple[int, int]) -> None:
|
|
self.position = position
|
|
self.garbage = []
|
|
self.is_visited = False
|
|
|
|
def add_garbage(self, garbage: Garbage) -> None:
|
|
self.garbage.append(garbage)
|
|
|
|
def remove_garbage(self, garbage: Garbage) -> None:
|
|
self.garbage.remove(garbage)
|
|
|
|
def render(self, game_context: GameContext) -> None:
|
|
game_context.render_in_cell(self.position, "imgs/container.png")
|
|
game_context.grid[self.position] = GridCellType.GARBAGE_CAN |