Last active
December 28, 2015 19:39
-
-
Save hayksaakian/7551288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@staticmethod | |
def get_adjacent_robots(self, game, player_comparator=None): | |
def generate(): | |
for loc,bot in game.get('robots').items(): | |
if rg.wdist(loc, self.location) <= 1: | |
if player_comparator == None or player_comparator(self.player_id, bot.player_id): | |
yield (loc, bot) | |
return dict(generate()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment