comparison agent.pl @ 329:c29c8dad0673

added rules for build ports
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 01:24:59 +0800
parents 3c6e78faa0d4
children fe740b1c6f94
comparison
equal deleted inserted replaced
328:6782280a886b 329:c29c8dad0673
62 } 62 }
63 63
64 sub is_branchOffice_enough { 64 sub is_branchOffice_enough {
65 my ($self, $city) = @_; 65 my ($self, $city) = @_;
66 return ($city->{buildings}->{branchOffice} >= 6 ? 1 : 0); 66 return ($city->{buildings}->{branchOffice} >= 6 ? 1 : 0);
67 }
68
69 sub is_port_enough {
70 my ($self, $city) = @_;
71 return ($city->{buildings}->{port} >= 12 ? 1 : 0);
67 } 72 }
68 73
69 sub is_space_enough { 74 sub is_space_enough {
70 my ($self, $city) = @_; 75 my ($self, $city) = @_;
71 # The maximum town hall is level 20, then we build new town 76 # The maximum town hall is level 20, then we build new town