sztuczna_inteligencja_2023_.../city.py

33 lines
831 B
Python
Raw Normal View History

2023-04-03 15:49:28 +02:00
from typing import List
2023-03-26 21:29:40 +02:00
from garbageCan import GarbageCan
2023-04-03 15:49:28 +02:00
from street import Street
from gameContext import GameContext
2023-03-26 21:29:40 +02:00
class Node:
garbageCan: GarbageCan
id: int
def __init__(self, id: int, can: GarbageCan) -> None:
2023-04-03 15:49:28 +02:00
self.id
2023-03-26 21:29:40 +02:00
self.can = can
class City:
nodes: List[Node]
2023-04-03 15:49:28 +02:00
streets: List[Street]
2023-03-26 21:29:40 +02:00
def __init__(self) -> None:
self.nodes = []
self.streets = []
def add_node(self, node: Node) -> None:
self.nodes.append(node)
2023-04-03 15:49:28 +02:00
def add_street(self, street: Street) -> None:
self.streets.append(street)
2023-03-26 21:29:40 +02:00
2023-04-03 15:49:28 +02:00
def render_city(self, game_context: GameContext) -> None:
self._render_streets(game_context)
def _render_streets(self, game_context: GameContext) -> None:
for street in self.streets:
street.render(game_context)