# HG changeset patch # User "Rex Tsai " # Date 1225419060 -28800 # Node ID 3bbb1e559e21e6814a848a38b5d6838d860df5e7 # Parent 454657d0308f0890865dd18d5277792803c0a4ff we are happy when the city level is more then 20 diff -r 454657d0308f -r 3bbb1e559e21 agent.pl --- a/agent.pl Fri Oct 31 02:21:49 2008 +0800 +++ b/agent.pl Fri Oct 31 10:11:00 2008 +0800 @@ -51,17 +51,16 @@ sub is_happiness { my ($self, $city) = @_; - # TODO 以 fuzzy 取出合理 happiness 值 + # FIXME. + # we should update the tavern setting. # we should update the travl - # return ($city->{growth} >= 5 ? 1 : 0) - # if($city->{buildings}->{townHall} <= 10); + return ($city->{growth} >= 5 ? 1 : 0) + if($city->{buildings}->{townHall} <= 10); - return 0; + return 1 if($city->{buildings}->{townHall} >= 20); - # FIXME. - # we should update the tavern setting. - # return ($city->{happiness} >= 2 ? 1 : 0); + return ($city->{happiness} >= 2 ? 1 : 0); } sub is_warehouse_enough {