# HG changeset patch # User "Rex Tsai " # Date 1239699709 -28800 # Node ID 0ec57ac68a4c63066e95f8f21c40e9e765afb616 # Parent e551351b18dec7fd43f9b74cec71ff652e19595d one more parameter for ship speed. diff -r e551351b18de -r 0ec57ac68a4c planner.pl --- a/planner.pl Tue Apr 14 17:01:17 2009 +0800 +++ b/planner.pl Tue Apr 14 17:01:49 2009 +0800 @@ -58,9 +58,10 @@ if($#ARGV < 2) { die("Usage: %s -n 1 -a 1 -v 21 targetCity navyCity armyCity wingman1.. wingman2..\n"); } -getopts('wa:n:v:'); +getopts('wa:n:v:s:'); $opt_n = defined($opt_n) ? $opt_n : 1; $opt_a = defined($opt_a) ? $opt_a : 1; +$opt_s = defined($opt_s) ? $opt_s : 33; my $vanguard = defined($opt_v) ? $opt_v : 21; my $targetCityId = shift(@ARGV); @@ -70,8 +71,8 @@ foreach my $i (1..$opt_n) { my $navyCity = shift(@ARGV); my $city = LoadFile(sprintf("city-%s-dump.yaml", $navyCity)); - $city->{travelTime} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, 33); - $city->{distance} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, 33) + $vanguard; + $city->{travelTime} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, $opt_s); + $city->{distance} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, $opt_s) + $vanguard; if($i == 1) { $city->{distance} += 8; } else {