Mercurial > eagle-eye
comparison warfare.pl @ 187:fa34cdb6879a
merged.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sun, 02 Nov 2008 21:19:07 +0800 |
parents | 8afd380c20ac |
children | dbdd7dcc91c6 |
comparison
equal
deleted
inserted
replaced
186:270e608bb0b6 | 187:fa34cdb6879a |
---|---|
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; |