Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/card.py
diff options
context:
space:
mode:
authorWalter 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)
commitf4e9be649585977bda66bcdafda9f25fb894c38d (patch)
tree8d8aabf8c340e3ddd1a25b2fc8b65122e8f4cd8a /card.py
parentd692af30c7dfa822bd9b049a01d27ac706254f0a (diff)
speed up of solver code
Diffstat (limited to 'card.py')
-rw-r--r--card.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/card.py b/card.py
index 22ed848..0f43b02 100644
--- a/card.py
+++ b/card.py
@@ -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) + \