Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/boardwidget.py
diff options
context:
space:
mode:
authorGerard J. Cerchio <gjpc@circlesoft.com>2007-12-11 21:55:12 (GMT)
committer Gerard J. Cerchio <gjpc@circlesoft.com>2007-12-11 21:55:12 (GMT)
commit42ef3bd6a2ff206db280e6133e5f7a351012dcdf (patch)
treeffa121c34d80e5acc6408479f90d82fa89cc902f /boardwidget.py
parent20ba7f69e3d2711a81d018695fd2b19cfd8144e2 (diff)
adopted Kombilo's abstract board, prisoners are removed
Diffstat (limited to 'boardwidget.py')
-rwxr-xr-xboardwidget.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/boardwidget.py b/boardwidget.py
index a2b868d..7da815c 100755
--- a/boardwidget.py
+++ b/boardwidget.py
@@ -173,16 +173,12 @@ class BoardWidget(gtk.EventBox):
def draw_stones( self, ctx ):
-
- for x in xrange(self.rows):
- for y in xrange(self.columns):
-
- point = self.myBoard.getPoint( x, y )
-
- if ( point == 1 ) :
- self.draw_stone( x, y, 1, self.lastUnit, ctx )
- elif ( point == 2 ) :
- self.draw_stone( x, y, 0, self.lastUnit, ctx )
+
+ for x in self.myBoard.status.keys() :
+ if self.myBoard.status[x] == 'B' :
+ self.draw_stone( x[0], x[1], 1, self.lastUnit, ctx )
+ else :
+ self.draw_stone( x[0], x[1], 0, self.lastUnit, ctx )
ctx.stroke()
@@ -253,14 +249,7 @@ class BoardWidget(gtk.EventBox):
self.emit('insert-requested', dat )
logger.debug( 'mouse up button event x=%d y=%d row=%d col=%d value=%x', event.x, event.y, x, y, dat )
-
-
-# self.myBoard.setPointi( col, row, self.lastColor )
-# if self.lastColor == 1:
-# self.lastColor = 2
-# else :
-# self.lastColor = 1
-#
+
self.window.invalidate_rect(self.get_allocation(), True)
def queue_draw(self):