diff options
author | rcoh <rcoh@mit.edu> | 2010-12-22 15:07:19 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2010-12-22 15:07:19 -0500 |
commit | d1215a57167f15a55c079cf6e0fb5d4b066ac8fd (patch) | |
tree | 0306733fc3db9717e74ed03946c74dd04ae48f50 /pixelmappers | |
parent | c581408f028d5b8ceadc53c68d7c1252fbe09e6d (diff) |
Done with pixel regions, with demo in behaviors/AllPixelsLeft.py. Need to finish up support for
multiple mappers.
Diffstat (limited to 'pixelmappers')
-rw-r--r-- | pixelmappers/SimpleMapper.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pixelmappers/SimpleMapper.py b/pixelmappers/SimpleMapper.py index 6b414ea..bc51cf9 100644 --- a/pixelmappers/SimpleMapper.py +++ b/pixelmappers/SimpleMapper.py @@ -19,8 +19,10 @@ class SimpleMapper(PixelMapper): eventLocation = eventLocation.replace('{y}', 'pixel.location[1]') for pixel in screen: try: - pixelValid = sum(eval(eventLocation)) == len(eventLocation) - ret.append((pixel, 1)) + pixelValid = sum(eval(eventLocation)) == len(eval(eventLocation)) #TODO: some + #optimizations possible. This might be slow in the long run + if pixelValid: + ret.append((pixel, 1)) except: raise Exception('Bad event condition') return ret |