diff gamelib/animal.py @ 378:71f5897ac5ef

Fences are now buildings, with appropriate (but ugly) UI changes.
author Jeremy Thurgood <firxen@gmail.com>
date Sat, 24 Oct 2009 19:08:54 +0000
parents b3c90e49a6b7
children 1586eccdefe4
line wrap: on
line diff
--- a/gamelib/animal.py	Tue Oct 13 20:35:05 2009 +0000
+++ b/gamelib/animal.py	Sat Oct 24 19:08:54 2009 +0000
@@ -425,7 +425,7 @@
 
     def _make_hole(self, gameboard):
         """Make a hole in the fence"""
-        gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.BROKEN_FENCE)
+        gameboard.get_building(self.dig_pos.to_tuple()).damage(gameboard.tv)
         self.dig_pos = None
 
     def move(self, gameboard):
@@ -505,7 +505,9 @@
 
     def _make_hole(self, gameboard):
         """The Rinkhals eats fences"""
-        gameboard.tv.set(self.dig_pos.to_tuple(), gameboard.GRASSLAND)
+        fence = gameboard.get_building(self.dig_pos.to_tuple())
+        fence.remove(gameboard.tv)
+        gameboard.remove_building(fence)
         self.dig_pos = None
 
     def damage(self, gameboard):