Mercurial > eagle-eye
comparison warfare.pl @ 189:7150e7b3dbec
merge
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sun, 02 Nov 2008 22:32:09 +0800 |
parents | 8afd380c20ac |
children | dbdd7dcc91c6 |
comparison
equal
deleted
inserted
replaced
188:bf4ddf5bffb9 | 189:7150e7b3dbec |
---|---|
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; |