Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorAndrés Ambrois <andresambrois@gmail.com>2008-09-11 05:47:47 (GMT)
committer Andrés Ambrois <andresambrois@gmail.com>2008-09-11 05:47:47 (GMT)
commit629fe20da1281cd4fe82ca491ec96cf823b28db3 (patch)
tree69bbded896862f1c885ed9a18fad56ec844dffbb /activity.py
parent945fc1978d1b4ac2fdf712bd6d37e539cb843bd1 (diff)
Mark territories at game end with pretty crosses. Update TODO
Modified patch by Nate Ridderman
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/activity.py b/activity.py
index b71adcd..ed30754 100644
--- a/activity.py
+++ b/activity.py
@@ -298,6 +298,7 @@ class PlayGo(Activity):
self.PlayerColor = 'B'
self.pass_count = 0
self.game.clear()
+ self.board.territories = None
self.board.status = self.game.status
self.board.do_expose_event()
self.show_score()
@@ -307,12 +308,14 @@ class PlayGo(Activity):
self.ai.clear()
def game_end(self):
- # TODO: Mark captured territories with pretty symbols
self.board.set_sensitive(False)
self.buttons_box.set_sensitive(False)
territories = self.game.get_territories()
- final_score = {'B':(len(territories['B']) - self.game.get_score()['W']),
+ self.board.territories = territories
+
+ final_score = {'B':(len(territories['B']) - self.game.get_score()['W']),
'W':(len(territories['W']) - self.game.get_score()['B'] + self.komi)}
+
if final_score['B'] > final_score['W']:
winner_string = _('Black wins!')
elif final_score['W'] > final_score['B']:
@@ -320,8 +323,7 @@ class PlayGo(Activity):
else:
winner_string = _('There was a tie!')
self.infopanel.show(_('Game ended! %s' % winner_string))
- self.infopanel.show_score(_('Final score: White %(W)d - Black %(B)d' % final_score))
-
+ self.infopanel.show_score(_('Final score: White %(W)d - Black %(B)d' % final_score))
def board_size_change(self, widget, size):
if size == self.size:
@@ -353,8 +355,8 @@ class PlayGo(Activity):
self._alert(_('AI'), _('PlayGo AI Deactivated'))
def notify_ai(self, x, y, color):
- logger.debug('Notifying AI of play by %s at %s x %s', color, x, y)
- self.ai.make_play(color, x, y)
+ logger.debug('Notifying AI of play by %s at %s x %s', color, x, y)
+ self.ai.make_play(color, x, y)
def play_ai(self):
if self.get_currentcolor() == self.get_playercolor():