redefinir metodo __str__() para mostrar info sobre objectos

This commit is contained in:
2024-09-10 11:56:28 +01:00
parent a6146abc8f
commit 700e79f9ba
3 changed files with 9 additions and 25 deletions

View File

@ -10,8 +10,9 @@ mapa.mostrar()
# Gui.App()
print(mapa)
pos_y = random.randint(0, tamanho_mundo[0])
pos_x = random.randint(0, tamanho_mundo[1])
obj_agente: Agente | None = mapa.posicao((pos_y, pos_x))
if obj_agente is not None:
obj_agente.mostrar()
print(obj_agente)