Skip to content

Commit

Permalink
name fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanfi79 committed Feb 8, 2020
1 parent 099c7e2 commit 23e860b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions AI.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
class AI:

# this function is called in the beginning for deck picking and preprocess
def pick(self, world):
print("pick")
#self.path_to_friend_check(world)
# self.path_to_friend_check(world)
world.choose_deck([1, 2, 3, 4])


def path_to_friend_check(self, world):
# path check:
print(world.get_me())
Expand All @@ -20,6 +19,7 @@ def path_to_friend_check(self, world):
print(world.get_second_enemy())
print(world.get_second_enemy().path_to_friend)

# it is called every turn for doing process during the game
def turn(self, world):
print("turn")
if world.get_current_turn() == 26:
Expand All @@ -35,6 +35,6 @@ def turn(self, world):
print("its turn 2!!!")
world.put_unit(base_unit=world.get_me().hand[0], path=world.get_me().paths_from_player[0])

#
def end(self, world, scores):
print("ending")

4 changes: 2 additions & 2 deletions world.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ def get_area_spell_targets(self, center, row=None, col=None, spell=None, type_id
if center is None:
center = Cell(row, col)
ls = []
for i in range(max(0, center.row - spell.range), min(center.row + spell.range, self.map.row_count)):
for j in range(max(0, center.col - spell.range), min(center.col + spell.range, self.map.column_count)):
for i in range(max(0, center.row - spell.range), min(center.row + spell.range, self.map.row_num)):
for j in range(max(0, center.col - spell.range), min(center.col + spell.range, self.map.column_num)):
cell = self.map.get_cell(i, j)
for u in cell.units:
if self._is_unit_targeted(u, spell.target):
Expand Down

0 comments on commit 23e860b

Please sign in to comment.