From 652ccba57669197aada1143ad0f61acb59578cd1 Mon Sep 17 00:00:00 2001 From: Simon Cross Date: Sat, 17 May 2014 19:46:59 +0200 Subject: [PATCH] Add parse_bits to utils. --- naja/utils.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/naja/utils.py b/naja/utils.py index b15302a..d5d17cc 100644 --- a/naja/utils.py +++ b/naja/utils.py @@ -27,6 +27,11 @@ def move_glyph(move_name): }.get(move_name, move_name.lower()) +def parse_bits(bit_list): + # Convert names to numbers if applicable. + return frozenset(BITS.get(bit, bit) for bit in bit_list) + + def warp_to_game_state(game_state): from naja.events import LoadGameEvent, SceneChangeEvent from naja.scenes.game import GameScene -- 2.34.1