comparison agent.pl @ 267:06ee88d2bb2a

fixed a typo
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 25 Nov 2008 23:08:00 +0800
parents 1b435cd26a7b
children c7f4a6f0fbde
comparison
equal deleted inserted replaced
266:53827cc442b6 267:06ee88d2bb2a
19 } 19 }
20 20
21 sub is_attacked { 21 sub is_attacked {
22 my ($self, $city) = @_; 22 my ($self, $city) = @_;
23 23
24 return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; 24 return ($self->{'ikariam'}->{'military'}->{attack} > 0 ) ? 1 : 0;
25 } 25 }
26 26
27 sub is_constructing { 27 sub is_constructing {
28 my ($self, $city) = @_; 28 my ($self, $city) = @_;
29 return ($city->{construction} > 0 ) ? 1 : 0; 29 return ($city->{construction} > 0 ) ? 1 : 0;
410 # build and upgrade for cities 410 # build and upgrade for cities
411 $tree = LoadFile('city.yaml'); 411 $tree = LoadFile('city.yaml');
412 $cities->{$cityId}->{parse_path} = []; 412 $cities->{$cityId}->{parse_path} = [];
413 $cities->{$cityId}->{parse_answer} = undef; 413 $cities->{$cityId}->{parse_answer} = undef;
414 if (my $action = ParseTree($tree, $rules, $cities->{$cityId})) { 414 if (my $action = ParseTree($tree, $rules, $cities->{$cityId})) {
415 # printf("%s is suppressed\n", $action);
415 triggerAction($action, $cityId); 416 triggerAction($action, $cityId);
416 } 417 }
417 DumpFile("city-$cityId-dump.yaml", $cities->{$cityId}); 418 DumpFile("city-$cityId-dump.yaml", $cities->{$cityId});
418 } 419 }
419 DumpFile("research-dump.yaml", $i->{'research'}); 420 DumpFile("research-dump.yaml", $i->{'research'});