Mercurial > eagle-eye
changeset 368:95148fdc1021
added time counting
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Thu, 05 Mar 2009 17:35:54 +0800 |
parents | d9d3cdff27c6 |
children | fb3cfa5533ac |
files | planner.pl |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/planner.pl Sun Mar 01 22:14:05 2009 +0800 +++ b/planner.pl Thu Mar 05 17:35:54 2009 +0800 @@ -91,7 +91,7 @@ if($i == 1) { $city->{distance} += 5; } else { - $city->{distance} += 2; + $city->{distance} += 1; } $city->{type} = "army"; $city->{queue} = "army" . $i; @@ -131,10 +131,11 @@ printf ("# %s %s [%s:%s]\n", $targetCity->owner, $targetCity->cityname, $targetCity->island->x, $targetCity->island->y); printf ("# http://%s/index.php?view=island&id=%d&selectCity=%d\n", $::server, $targetCity->island->id, $targetCity->id); printf("#\n"); +printf("my \$delay = 0; # minutes\n"); @cities = sort { $b->{distance} <=> $a->{distance}; } (@cities); foreach my $i (0..$#cities) { - printf('printf("%%s %s %s %s %sm\n", calcTime(%s - %s, %s));', + printf('printf("%%s %s %s %s %sm\n", calcTime(%s - %s + $delay, %s));', $cities[$i]->{queue}, $cities[$i]->{name}, $cities[$i]->{id}, $cities[$i]->{travelTime}, $cities[0]->{distance}, $cities[$i]->{distance}, $cities[$i]->{travelTime}); printf(" # %s\n", calcTime($cities[0]->{distance} - $cities[$i]->{distance}, $cities[$i]->{travelTime}));