diff 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
line wrap: on
line diff
--- a/warfare.pl	Sun Nov 02 18:36:28 2008 +0800
+++ b/warfare.pl	Sun Nov 02 21:19:07 2008 +0800
@@ -53,6 +53,14 @@
     return ($city->{transporters}->{avail} > 0) ? 1 : 0;
 }
 
+sub is_port_available {
+    my ($self, $city) = @_;
+    foreach(1..2) {
+        return 1 if($city->{locations}[$_] eq 'port');
+    }
+    return 0;
+}
+
 sub is_army_available {
     my ($self, $city) = @_;
     return ($city->{army}->{Swordsman} >= 2 ) ? 1 : 0;