diff gamelib/animal.py @ 104:d17375586866

Add .covers(tile_pos) to animals (to match similar function on buildings).
author Simon Cross <hodgestar@gmail.com>
date Wed, 02 Sep 2009 18:09:57 +0000
parents 725b292ca07b
children 437cbd856a03
line wrap: on
line diff
--- a/gamelib/animal.py	Wed Sep 02 18:05:04 2009 +0000
+++ b/gamelib/animal.py	Wed Sep 02 18:09:57 2009 +0000
@@ -44,6 +44,9 @@
     def weapons(self):
         return [e for e in self.equipment if e.is_weapon]
 
+    def covers(self, tile_pos):
+        return tile_pos[0] == self.pos.x and tile_pos[1] == self.pos.y
+
 class Chicken(Animal):
     """A chicken"""