Mercurial > rinkhals
comparison gamelib/buildings.py @ 144:a9b800b4175e
Add define for henhouses & egg laying.
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 03 Sep 2009 14:59:13 +0000 |
parents | 9acf8e3d9596 |
children | 92d11e0544bc |
comparison
equal
deleted
inserted
replaced
143:f174ef6b26ba | 144:a9b800b4175e |
---|---|
198 | 198 |
199 def is_building(obj): | 199 def is_building(obj): |
200 """Return true if obj is a build class.""" | 200 """Return true if obj is a build class.""" |
201 return getattr(obj, "IS_BUILDING", False) and hasattr(obj, "NAME") | 201 return getattr(obj, "IS_BUILDING", False) and hasattr(obj, "NAME") |
202 | 202 |
203 # Building hens can lay eggs in | |
204 HENHOUSES = [HenHouse.NAME, DoubleStoryHenHouse.NAME] | |
205 | |
203 BUILDINGS = [] | 206 BUILDINGS = [] |
204 for name in dir(): | 207 for name in dir(): |
205 obj = eval(name) | 208 obj = eval(name) |
206 try: | 209 try: |
207 if is_building(obj): | 210 if is_building(obj): |