changeset 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 6782280a886b
children 484aaddeef66
files agent.pl city.yaml
diffstat 2 files changed, 7 insertions(+), 0 deletions(-) [+]
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
--- a/city.yaml	Thu Feb 12 01:19:27 2009 +0800
+++ b/city.yaml	Thu Feb 12 01:24:59 2009 +0800
@@ -68,6 +68,8 @@
                            0: build_academy
                   - is_branchOffice_enough:
                      0: build_branchOffice
+                  - is_port_enough:
+                     0: build_port
 
 # 水晶島應該建設 
 # is_invention_researched