-
- @staticmethod
- def generate_location_actions():
- raise NotImplementedError("TODO")
-
- def apply_bitwise_operation(self, player):
- operator = {
- 'SET': player.bits.set_bits,
- 'CLEAR': player.bits.clear_bits,
- 'TOGGLE': player.bits.toggle_bits,
- }[self.bitwise_operation]
- operator(self.bitwise_operand)
-
-
-class LocationAction(object):
- """
- An action that may be performed on a location.
- """
-
- REQUIRED_BITS = frozenset()
-
- def __init__(self, **data):
- self.data = data
-
- def check_available(self, player):
- return player.bits.check_bits(self.REQUIRED_BITS)
-
- def perform_action(self, player, board):
- raise NotImplementedError("TODO")