diff agent.pl @ 329:c29c8dad0673

added rules for build ports
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 12 Feb 2009 01:24:59 +0800
parents 3c6e78faa0d4
children fe740b1c6f94
line wrap: on
line diff
--- a/agent.pl	Thu Feb 12 01:19:27 2009 +0800
+++ b/agent.pl	Thu Feb 12 01:24:59 2009 +0800
@@ -66,6 +66,11 @@
     return ($city->{buildings}->{branchOffice} >= 6 ?  1 : 0);
 }
 
+sub is_port_enough {
+    my ($self, $city) = @_;
+    return ($city->{buildings}->{port} >= 12 ?  1 : 0);
+}
+
 sub is_space_enough {
     my ($self, $city) = @_;
     # The maximum town hall is level 20, then we build new town