Factored some relevant data into the GoGame class, made Game -> Close work correctly

This commit is contained in:
Anna Rose 2012-04-17 14:59:46 -04:00
parent 00b65a65df
commit f596e0f3ee
2 changed files with 8 additions and 15 deletions

21
pygo.py
View File

@ -18,10 +18,7 @@ class Pygo():
def __init__(self):
self.resize = True
self.goban = None
self.network_mode = False
self.our_color = None
self.go_game = None
self.init_user_interface('./ui/default.glade')
self.init_widgets()
@ -41,21 +38,17 @@ class Pygo():
def on_game_close(self, widget):
print 'Pygo.on_game_close(): stub'
def on_local_new(self, widget):
if self.gogame:
self.contents.remove(self.gogame)
self.gogame = None
if self.goban:
self.goban = None
self.goban = goban.Goban()
self.network_mode = False
self.our_color = None
self.gogame = gogame.GoGame(self.goban)
def on_local_new(self, widget):
# Remove any existing game
# fixme - we'll remove this later and add a new concurrent game instead
self.on_game_close(None)
self.gogame = gogame.GoGame(goban.Goban())
self.contents.pack_start(self.gogame)
self.gogame.show_all()

View File

@ -15,7 +15,7 @@ class GoGame(gtk.HBox):
img_res = None
def __init__(self, goban):
def __init__(self, goban, network_mode=False, our_color=None):
super(GoGame, self).__init__()
self.goban = goban