Treat tile_selected as an overlay that applies to the base tile image.
[naja.git] / naja / player.py
index ff253da35ea3113216240649fa4dfe8a0dbf5dab..00e6133ed720486bd19d878136abcdcd5087b86a 100644 (file)
@@ -91,3 +91,11 @@ class Player(object):
             self.position = new_position
             return True
         return False
+
+    def legal_moves(self):
+        positions = [self.position]
+        for direction in [BITS.NORTH, BITS.SOUTH, BITS.EAST, BITS.WEST]:
+            position = self.get_adjacent_position(direction)
+            if position is not None and self.bits.check_bit(direction):
+                positions.append(position)
+        return positions