Skip to content

Commit

Permalink
useless func deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
erfanfi79 committed Feb 14, 2020
1 parent 97fc77f commit 6422a6b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
3 changes: 1 addition & 2 deletions AI.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def turn(self, world):
if len(my_units) > 0:
unit = my_units[0]
my_paths = myself.paths_from_player
path = my_paths[random.randint(0, len(my_paths) - 1)]
path = my_paths[random.randint(0, len(my_paths) - 1)]
size = len(path.cells)
cell = path.cells[(size + 1) / 2]
world.cast_unit_spell(unit=unit, path=path, cell=cell, spell=received_spell)
Expand All @@ -78,4 +78,3 @@ def turn(self, world):
def end(self, world, scores):
print("end started!")
print("My score: " + scores[world.get_me().player_id])

8 changes: 1 addition & 7 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,6 @@ def __init__(self, max_ap, max_turns, turn_timeout, pick_timeout,
self.deck_size = deck_size
self.hand_size = hand_size

# if World.DEBUGGING_MODE:
# import datetime
# World.LOG_FILE_POINTER = open('client' + '-' +
# datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S.%f") + '.log', 'w+')


class TurnUpdates:
def __init__(self, received_spell=None, friend_received_spell=None,
Expand All @@ -347,5 +342,4 @@ def __init__(self, received_spell=None, friend_received_spell=None,
self.got_damage_upgrade = turn_updates.got_damage_upgrade
self.available_damage_upgrade = turn_updates.available_damage_upgrades
self.available_range_upgrade = turn_updates.available_range_upgrades
turn_updates.received_spell = None
turn_updates.friend_received_spell = None
turn_updates = None
9 changes: 0 additions & 9 deletions world.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,6 @@ def _spells_init(self, msg):
for spell in msg]

def _handle_init_message(self, msg):
# if World.DEBUGGING_MODE:
# if World.LOG_FILE_POINTER is not None:
# World.LOG_FILE_POINTER.write(str(msg))
# World.LOG_FILE_POINTER.write('\n')
self._game_constant_init(msg['gameConstants'])
self._map_init(msg["map"])
self._base_unit_init(msg["baseUnits"])
Expand Down Expand Up @@ -337,11 +333,6 @@ def get_paths_crossing_cell(self, cell=None, row=None, col=None):
paths.append(p)
return paths

# # return units of player that are currently in map
# def get_player_units(self, player_id):
# player = self.get_player_by_id(player_id)
# return player.units

# return a list of units in a cell
def get_cell_units(self, cell=None, row=None, col=None):
if cell is None:
Expand Down

0 comments on commit 6422a6b

Please sign in to comment.