From e5731d2cbc0c7a260e7b69aac07e6c26b9b2c56d Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 19:47:16 +0200 Subject: [PATCH] Use parse_bits from utils. --- naja/gameboard.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/naja/gameboard.py b/naja/gameboard.py index 9855546..ff65c25 100644 --- a/naja/gameboard.py +++ b/naja/gameboard.py @@ -7,6 +7,7 @@ from naja.options import options from naja.player import Player from naja import actions from naja.sound import sound +from naja.utils import parse_bits import random @@ -315,14 +316,14 @@ class LocationCard(object): @classmethod def build_action(cls, definition): action_class = getattr(actions, definition['action_class']) - required_bits = cls.parse_bits(definition['required_bits']) + required_bits = parse_bits(definition['required_bits']) data = definition.get('data', {}) return action_class(required_bits, **data) @classmethod def new_location(cls, definition, replacement_params=None, puzzle=False): if 'bits' in definition: - bits = cls.parse_bits(definition['bits']) + bits = parse_bits(definition['bits']) else: bits = cls.generate_bitwise_operand() @@ -345,11 +346,6 @@ class LocationCard(object): location.check_actions() return location - @classmethod - def parse_bits(self, bit_list): - # Convert names to numbers if applicable. - return frozenset(BITS.get(bit, bit) for bit in bit_list) - def export(self): return { 'bitwise_operand': sorted(self.bitwise_operand), -- 2.34.1