diff options
author | Walter Bender <walter@walter-laptop.(none)> | 2009-10-09 06:10:52 (GMT) |
---|---|---|
committer | Walter Bender <walter@walter-laptop.(none)> | 2009-10-09 06:10:52 (GMT) |
commit | f4e9be649585977bda66bcdafda9f25fb894c38d (patch) | |
tree | 8d8aabf8c340e3ddd1a25b2fc8b65122e8f4cd8a /card.py | |
parent | d692af30c7dfa822bd9b049a01d27ac706254f0a (diff) |
speed up of solver code
Diffstat (limited to 'card.py')
-rw-r--r-- | card.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -57,11 +57,11 @@ class Card: '.svg'), \ int(wh), int(wh)) - def set_orientation(self,r): + def set_orientation(self,r,rotate_spr=True): while r != self.orientation: - self.rotate_ccw() + self.rotate_ccw(rotate_spr) - def rotate_ccw(self): + def rotate_ccw(self,rotate_spr=True): # print "rotating card " + str(self.spr.label) tmp = self.north self.north = self.east @@ -71,8 +71,9 @@ class Card: self.orientation += 90 if self.orientation > 359: self.orientation -= 360 - tmp = self.spr.image.rotate_simple(90) - self.spr.image = tmp + if rotate_spr is True: + tmp = self.spr.image.rotate_simple(90) + self.spr.image = tmp def print_card(self): print "(" + str(self.north) + "," + str(self.east) + \ |