comparison agent.pl @ 89:86402d28544f

stop upgrade townHall after the level is 20.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 26 Oct 2008 16:20:48 +0800
parents 4c82cf844aa8
children 73f0a1cafc23
comparison
equal deleted inserted replaced
88:0fa9cd836e1e 89:86402d28544f
37 37
38 sub is_space_enough { 38 sub is_space_enough {
39 my ($self, $city) = @_; 39 my ($self, $city) = @_;
40 # TODO 應該以消耗率/時間計算 40 # TODO 應該以消耗率/時間計算
41 # $self->{ikariam}->{growth} 41 # $self->{ikariam}->{growth}
42 return 1 if($city->{buildings}->{townHall} >= 20);
42 return ($city->{space}->{total} <= ($city->{space}->{occupied}+6) ? 0 : 1) 43 return ($city->{space}->{total} <= ($city->{space}->{occupied}+6) ? 0 : 1)
43 } 44 }
44 45
45 sub is_corruption { 46 sub is_corruption {
46 my ($self, $city) = @_; 47 my ($self, $city) = @_;