From: Jeremy Thurgood Date: Fri, 16 May 2014 08:07:32 +0000 (+0200) Subject: Better bits constants. X-Git-Tag: 0.1~242 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=4f98485cecd1089f71819cc9f50577c35dc3c219;hp=aac1783aa9c84031bb37d74616ee72a7b32ebeac;p=naja.git Better bits constants. --- diff --git a/naja/constants.py b/naja/constants.py index f81cb8f..c941401 100644 --- a/naja/constants.py +++ b/naja/constants.py @@ -24,20 +24,21 @@ DEFAULT_SOUND_VOLUME = 1.0 # sound volume DEFAULT_MUSIC_VOLUME = 0.3 # music volume # Player bits -BITS = AttrDict({ - # Direction bits +DIRECTION_BITS = AttrDict({ 'NORTH': 0, 'SOUTH': 1, 'EAST': 2, 'WEST': 3, - # Condition bits +}) +CONDITION_BITS = AttrDict({ 'BLUE': 4, 'GREEN': 5, 'RED': 6, 'MSB': 7, }) -DIRECTION_BITS = AttrDict((k, v) for k, v in BITS.items() if v < 4) -CONDITION_BITS = AttrDict((k, v) for k, v in BITS.items() if v >= 4) +BITS = AttrDict() +BITS.update(DIRECTION_BITS) +BITS.update(CONDITION_BITS) # PLAYER MOVES MOVES = AttrDict({