comparison Ikariam.pm @ 30:de5de6d472f9

added space checking
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 10 Oct 2008 05:24:04 +0800
parents dbec53e754e3
children 91e387b51aa0
comparison
equal deleted inserted replaced
29:dbec53e754e3 30:de5de6d472f9
262 $self->{'cities'}->{$cityId}->{gold} = $elem->innerText(); 262 $self->{'cities'}->{$cityId}->{gold} = $elem->innerText();
263 $self->{'cities'}->{$cityId}->{gold} =~ s/,//g; 263 $self->{'cities'}->{$cityId}->{gold} =~ s/,//g;
264 264
265 my ($elem) = $html->getElementsByAttribute("class", "city"); 265 my ($elem) = $html->getElementsByAttribute("class", "city");
266 $self->{'cities'}->{$cityId}->{name} = $elem->innerText(); 266 $self->{'cities'}->{$cityId}->{name} = $elem->innerText();
267
268 my ($elem) = $html->getElementsByAttribute("class", 'constructionSite');
269 $self->{'cities'}->{$cityId}->{construction} = 0;
270 $self->{'cities'}->{$cityId}->{construction} = 1 if(defined($elem));
267 271
268 # check goods 272 # check goods
269 foreach my $good (qw/wood wine marble crystal sulfur/) { 273 foreach my $good (qw/wood wine marble crystal sulfur/) {
270 my ($elem) = $html->getElementsByAttribute("id", "value_" . $good); 274 my ($elem) = $html->getElementsByAttribute("id", "value_" . $good);
271 $self->{'cities'}->{$cityId}->{$good} = $elem->innerText(); 275 $self->{'cities'}->{$cityId}->{$good} = $elem->innerText();