comparison gamelib/gameboard.py @ 264:812bd4cda8b8

evict button
author Neil Muller <drnlmuller@gmail.com>
date Sat, 05 Sep 2009 13:56:43 +0000
parents d508248041ff
children 31f5033eac70
comparison
equal deleted inserted replaced
263:8896bae31eda 264:812bd4cda8b8
560 building.selected(True) 560 building.selected(True)
561 def close_callback(): 561 def close_callback():
562 building.selected(False) 562 building.selected(False)
563 563
564 def evict_callback(): 564 def evict_callback():
565 print 'evict called', self.animal_to_place 565 if not self.animal_to_place:
566 return
567 for tile_pos in building.adjacent_tiles():
568 if self.tv.get(tile_pos) != self.GRASSLAND:
569 continue
570 if self.get_outside_chicken(tile_pos) is None:
571 update_button(self.animal_to_place, empty=True)
572 self.place_animal(tile_pos)
573 break
566 574
567 if not sell_callback: 575 if not sell_callback:
568 tbl.tr() 576 tbl.tr()
569 button = gui.Button('Evict') 577 button = gui.Button('Evict')
570 button.connect(gui.CLICK, evict_callback) 578 button.connect(gui.CLICK, evict_callback)