comparison warfare.pl @ 185:c6c6db6eea76

merged.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 02 Nov 2008 21:17:50 +0800
parents 8afd380c20ac
children dbdd7dcc91c6
comparison
equal deleted inserted replaced
184:857a67be1609 185:c6c6db6eea76
49 } 49 }
50 50
51 sub is_transporters_available { 51 sub is_transporters_available {
52 my ($self, $city) = @_; 52 my ($self, $city) = @_;
53 return ($city->{transporters}->{avail} > 0) ? 1 : 0; 53 return ($city->{transporters}->{avail} > 0) ? 1 : 0;
54 }
55
56 sub is_port_available {
57 my ($self, $city) = @_;
58 foreach(1..2) {
59 return 1 if($city->{locations}[$_] eq 'port');
60 }
61 return 0;
54 } 62 }
55 63
56 sub is_army_available { 64 sub is_army_available {
57 my ($self, $city) = @_; 65 my ($self, $city) = @_;
58 return ($city->{army}->{Swordsman} >= 2 ) ? 1 : 0; 66 return ($city->{army}->{Swordsman} >= 2 ) ? 1 : 0;