Skip to content

Commit 79d7c16

Browse files
author
AH-Pooya
committed
Protected in python is a damn joke
1 parent b335f79 commit 79d7c16

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

AI.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
import Model
23
from random import randint
34

@@ -25,4 +26,4 @@ def action(self, world):
2526
col_num = randint(0, world.map.column_num)
2627
abilities = hero.abilities
2728
world.cast_ability(hero=hero, ability=abilities[randint(0, len(abilities) - 1)],
28-
cell=world.map.get_cell(row_num, col_num))
29+
cell=world.map.get_cell(row_num, col_num))

Model.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -744,13 +744,13 @@ def get_ability_targets(self, ability_name=None, ability=None, ability_constant=
744744
return None
745745
target_cell = self.map.get_cell(target_row, target_column)
746746

747-
cells = self.get_impact_cells(ability_name, start_cell, target_cell)
747+
cells = self.get_impact_cells(ability_constant, start_cell, target_cell)
748748
affected_cells = set()
749749
for cell in cells:
750750
affected_cells.update(self.get_cells_in_aoe(cell, ability_constant.area_of_effect))
751751
if ability_constant.type == AbilityType.HEAL:
752752
return self.get_my_heroes_in_cells(cells)
753-
return self.get_opp_heroes_in_cells(cells)
753+
return self._get_opp_heroes_in_cells(cells)
754754

755755
def get_my_heroes_in_cells(self, cells):
756756
heroes = []
@@ -760,10 +760,10 @@ def get_my_heroes_in_cells(self, cells):
760760
heroes.append(hero)
761761
return heroes
762762

763-
def get_opp_heroes_in_cells(self, cells):
763+
def _get_opp_heroes_in_cells(self, cells):
764764
heroes = []
765765
for cell in cells:
766-
hero = self.get_opp_hero(cell)
766+
hero = self._get_opp_hero(cell)
767767
if hero:
768768
heroes.append(hero)
769769
return heroes

0 commit comments

Comments
 (0)