Skip to content

Commit a8b8ecd

Browse files
author
renzon
committed
Obstáculo Ok
1 parent 6ab0ac0 commit a8b8ecd

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

atores.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ def esta_no_intervalo(coordenada1, coordenada2, intervalo=1):
3838
return True
3939
return False
4040

41+
4142
class Obstaculo(Ator):
42-
pass
43+
caracter = 'O'
44+
45+
def calcular_posicao(self, tempo):
46+
x, y, caracter = super().calcular_posicao(tempo)
47+
return x, y, ' ' if self.status == DESTRUIDO else caracter
48+
49+
50+
4351

4452

testes/atores_testes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def teste_status(self):
8686
self.assertEqual(ATIVO, obstaculo.status)
8787
self.assertEqual('O', obstaculo.calcular_posicao(0)[2])
8888
obstaculo.status = DESTRUIDO
89-
self.assertEqual('', obstaculo.calcular_posicao(0)[2])
89+
self.assertEqual(' ', obstaculo.calcular_posicao(0)[2])
9090
self.assertEqual(ATIVO, Ator().status)
9191

9292

0 commit comments

Comments
 (0)