Exemple #1
0
 def test_distance(self):
     from warlord.path import distance
     tileA = Mock()
     tileB = Mock()
     tileA.location = (0, 0)
     tileB.location = (0, 1)
     self.assertEquals(distance(tileA, tileB), 1)
Exemple #2
0
def is_in_range(unitA, unitB):
    dist = distance(unitA.tile, unitB.tile) - 1
    return dist in unitA.equipped_item.attack_range