ClearBits action
authorStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 17:42:43 +0000 (19:42 +0200)
committerStefano Rivera <stefano@rivera.za.net>
Sat, 17 May 2014 17:42:51 +0000 (19:42 +0200)
naja/actions.py

index c96a219a6ec28e9382d0abc81c88d8736f7498b1..dc8f3e6af74077bd8afdd58028b270af07030e80 100644 (file)
@@ -98,6 +98,14 @@ class SetBits(LocationAction):
         board.player.bits.set_bits(location.bitwise_operand)
 
 
+class ClearBits(LocationAction):
+    TEXT = "Clear %(location_bits)s."
+    GLYPHS = (ACTION_GLYPHS.CLEAR_BITS,)
+
+    def perform_action(self, board, location):
+        board.player.bits.clear_bits(location.bitwise_operand)
+
+
 class ToggleBits(LocationAction):
     TEXT = "Toggle %(location_bits)s."
     GLYPHS = (ACTION_GLYPHS.TOGGLE_BITS,)