diff pyikriam/example.py @ 176:3ba3edda6d1e

Extract more information for building townhall.
author Thinker K.F. Li <thinker@branda.to>
date Sun, 02 Nov 2008 11:32:59 +0800
parents 8f699a9da6c0
children 6adad3bcca78
line wrap: on
line diff
--- a/pyikriam/example.py	Sun Nov 02 09:59:51 2008 +0800
+++ b/pyikriam/example.py	Sun Nov 02 11:32:59 2008 +0800
@@ -24,4 +24,11 @@
 print 'positions ' + repr(city.positions)
 
 city.positions[0].sync()
-print 'positions[0] level is ' + str(city.positions[0].level)
+city_attrs = ('level', 'occupied', 'rooms', 'growth', 'happiness',
+              'interest_base', 'interest_research', 'interest_capital',
+              'pop_citizens', 'pop_woodworkers', 'pop_specialworkers',
+              'pop_scientists', 'is_upgrading', 'upgrade_uri')
+for city_attr in city_attrs:
+    value = getattr(city.positions[0], city_attr)
+    print 'positions[0].%s is %s' % (city_attr, str(value))
+    pass