diff agent.pl @ 207:48ea8222782a

automatic build spys
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 03 Nov 2008 18:40:15 +0800
parents b7af307a222d
children a2bb38589172
line wrap: on
line diff
--- a/agent.pl	Mon Nov 03 17:52:28 2008 +0800
+++ b/agent.pl	Mon Nov 03 18:40:15 2008 +0800
@@ -211,18 +211,6 @@
     }
 }
 
-sub rule_engagement
-{
-    my ($self, $city) = @_;
-    # TODO
-    # 計算距離, 可搶劫比例, 是否有聯盟, 軍事分數 (win rate)
-}
-
-sub rule_resource
-{
-    # TODO 
-}
-
 sub is_shipyard_upgrading {
     my ($self, $city) = @_;
     return $self->{'ikariam'}->is_shipyard_upgrading($city->{id});
@@ -259,7 +247,6 @@
     my ($self, $city) = @_;
     return $self->{ikariam}->is_army_trainning($city->{id});
 }
-
 sub train_army {
     my ($self, $city) = @_;
     my $cityId = $city->{id};
@@ -332,6 +319,7 @@
     }
     return 0;
 }
+
 1; 
 
 
@@ -368,7 +356,11 @@
 
     # maybe this should be moved to Rules.
     $i->blanceHurmanResource($cityId);
-    
+ 
+    # build spy
+    $i->buildSpy('spy', $cityId);
+
+    # build military!
     $tree  = LoadFile('military.yaml');
     $cities->{$cityId}->{parse_path} = [];
     $cities->{$cityId}->{parse_answer} = undef;