Clean plansza.py
This commit is contained in:
parent
97fdd46adf
commit
d3960dcc91
26
plansza.py
26
plansza.py
@ -38,19 +38,6 @@ class Plansza:
|
||||
else:
|
||||
print('Nie mozna ruszyc jednostki na to pole - za duzy dystans')
|
||||
|
||||
def czy_zajete(self, x, y):
|
||||
if self.pole[x][y] == 'O':
|
||||
return False
|
||||
return True
|
||||
|
||||
def wyswietl(self):
|
||||
print()
|
||||
for y in range(5):
|
||||
for x in range(5):
|
||||
print(self.pole[x][y], end=' ')
|
||||
print()
|
||||
print()
|
||||
|
||||
def wykonaj_atak(self, atakujacy, cel):
|
||||
if self.sprawdz_zasieg(atakujacy, cel):
|
||||
cel.otrzymaj_obrazenia(self.oblicz_obrazenia(atakujacy, cel))
|
||||
@ -73,8 +60,21 @@ class Plansza:
|
||||
obrazenia = atakujacy.sila_ataku
|
||||
return obrazenia
|
||||
|
||||
def czy_zajete(self, x, y):
|
||||
if self.pole[x][y] == 'O':
|
||||
return False
|
||||
return True
|
||||
|
||||
def znajdz(self, jednostka):
|
||||
for y in range(5):
|
||||
for x in range(5):
|
||||
if self.pole[x][y] == jednostka:
|
||||
return x, y
|
||||
|
||||
def wyswietl(self):
|
||||
print()
|
||||
for y in range(5):
|
||||
for x in range(5):
|
||||
print(self.pole[x][y], end=' ')
|
||||
print()
|
||||
print()
|
Loading…
Reference in New Issue
Block a user