From: Stefano Rivera Date: Sat, 17 May 2014 17:42:43 +0000 (+0200) Subject: ClearBits action X-Git-Tag: 0.1~60 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=90cf8e0e0006bd9258f6100fcdf2312363543815;p=naja.git ClearBits action --- diff --git a/naja/actions.py b/naja/actions.py index c96a219..dc8f3e6 100644 --- a/naja/actions.py +++ b/naja/actions.py @@ -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,)