comparison Ikariam.pm @ 100:ed6160630329

save actionPoints.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 29 Oct 2008 03:20:53 +0800
parents 34749e907405
children 592d3b3b7898
comparison
equal deleted inserted replaced
99:b35c7aaef8ca 100:ed6160630329
607 607
608 my @values = $extractor->find('//div[@id="CityOverview"]//span[@class="value"]'); 608 my @values = $extractor->find('//div[@id="CityOverview"]//span[@class="value"]');
609 $self->{'cities'}->{$cityId}->{"growth"} = $values[0]; 609 $self->{'cities'}->{$cityId}->{"growth"} = $values[0];
610 $self->{'cities'}->{$cityId}->{"incomegold"} = $values[1]; 610 $self->{'cities'}->{$cityId}->{"incomegold"} = $values[1];
611 611
612 my $actionPoints = $extractor->find('//div[@id="CityOverview"]//li[@class="actions"]/text()');
613 if($actionPoints =~ /(\d+)\/(\d+)/) {
614 $self->{'cities'}->{$cityId}->{actionPoints} = $1;
615 $self->{'cities'}->{$cityId}->{maxActionPoints} = $2;
616 }
617
612 $self->{'cities'}->{$cityId}->{corruption} = $extractor->find('//li[@class="corruption"]//span[@title="目前腐敗程度"]'); 618 $self->{'cities'}->{$cityId}->{corruption} = $extractor->find('//li[@class="corruption"]//span[@title="目前腐敗程度"]');
613 $self->{'cities'}->{$cityId}->{corruption} =~ s/%//g; 619 $self->{'cities'}->{$cityId}->{corruption} =~ s/%//g;
614 620
615 my @citizens_type = qw/citizens woodworkers specialworkers scientists/; 621 my @citizens_type = qw/citizens woodworkers specialworkers scientists/;
616 @values = $extractor->find('//div[@id="PopulationGraph"]//span[@class="count"]'); 622 @values = $extractor->find('//div[@id="PopulationGraph"]//span[@class="count"]');