Mercurial > eagle-eye
comparison 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 |
comparison
equal
deleted
inserted
replaced
175:9f248c8460ce | 176:3ba3edda6d1e |
---|---|
22 print 'crystal is ' + city.crystal | 22 print 'crystal is ' + city.crystal |
23 print 'sulfur is ' + city.sulfur | 23 print 'sulfur is ' + city.sulfur |
24 print 'positions ' + repr(city.positions) | 24 print 'positions ' + repr(city.positions) |
25 | 25 |
26 city.positions[0].sync() | 26 city.positions[0].sync() |
27 print 'positions[0] level is ' + str(city.positions[0].level) | 27 city_attrs = ('level', 'occupied', 'rooms', 'growth', 'happiness', |
28 'interest_base', 'interest_research', 'interest_capital', | |
29 'pop_citizens', 'pop_woodworkers', 'pop_specialworkers', | |
30 'pop_scientists', 'is_upgrading', 'upgrade_uri') | |
31 for city_attr in city_attrs: | |
32 value = getattr(city.positions[0], city_attr) | |
33 print 'positions[0].%s is %s' % (city_attr, str(value)) | |
34 pass |