comparison agent.pl @ 289:4c1eb583b97c

new function for checking shipyard
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 05 Dec 2008 20:22:01 +0800
parents b2510d9339d8
children cdbb428b464c
comparison
equal deleted inserted replaced
288:24de33db8284 289:4c1eb583b97c
234 return ($city->{buildings}->{barracks} >= 5 ? 1 : 0); 234 return ($city->{buildings}->{barracks} >= 5 ? 1 : 0);
235 } else { 235 } else {
236 # 方陣兵需要 level 4 236 # 方陣兵需要 level 4
237 return ($city->{buildings}->{barracks} >= 4 ? 1 : 0); 237 return ($city->{buildings}->{barracks} >= 4 ? 1 : 0);
238 } 238 }
239 }
240
241 sub is_shipyard_availble {
242 my ($self, $city) = @_;
243 return 0 if(!defined($city->{buildings}->{shipyard}));
244 return 1;
239 } 245 }
240 246
241 sub is_shipyard_level_enough { 247 sub is_shipyard_level_enough {
242 my ($self, $city) = @_; 248 my ($self, $city) = @_;
243 return 0 if(!defined($city->{buildings}->{shipyard})); 249 return 0 if(!defined($city->{buildings}->{shipyard}));