comparison freeland.pl @ 279:a9847bf80058

refined coding style
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 02 Dec 2008 17:13:36 +0800
parents dba0543daf36
children
comparison
equal deleted inserted replaced
278:b2510d9339d8 279:a9847bf80058
34 AND y <= $location[2] 34 AND y <= $location[2]
35 AND y >= $location[3] 35 AND y >= $location[3]
36 }); 36 });
37 37
38 if($#islands == -1) { 38 if($#islands == -1) {
39 my @cities = Ikariam::Cities->search_lamers(@location); 39 my @cities = Ikariam::Cities->search_lamers(@location);
40 foreach my $city (@cities) { 40 foreach my $city (@cities) {
41 my $island = Ikariam::Island->retrieve($city->island); 41 my $island = Ikariam::Island->retrieve($city->island);
42 my $user = Ikariam::User->retrieve($city->user); 42 my $user = Ikariam::User->retrieve($city->user);
43 printf("%s (%d) \"%s\" %d [%d,%d] http://%s/index.php?view=island&id=%d&selectCity=%d\n", 43 printf("%s (%d) \"%s\" %d [%d,%d] http://%s/index.php?view=island&id=%d&selectCity=%d\n",
44 $user->name, $user->score, 44 $user->name, $user->score,
45 $city->cityname, $city->citylevel, 45 $city->cityname, $city->citylevel,
46 $island->x, $island->y, 46 $island->x, $island->y,
47 $::server, 47 $::server,
48 $island->id, 48 $island->id,
49 $city->cityId 49 $city->cityId
50 ); 50 );
51 } 51 }
52 } else { 52 } else {
53 # 依照距離列表 53 # 依照距離列表
54 foreach my $island (@islands) 54 foreach my $island (@islands)
55 { 55 {
56 printf("%d [%d:%d] %s %s http://%s/index.php?view=island&id=%d%s\n", 56 printf("%d [%d:%d] %s %s http://%s/index.php?view=island&id=%d%s\n",
57 (abs($x-$island->x) + abs($y-$island->y)), # minutes ? 57 (abs($x-$island->x) + abs($y-$island->y)), # minutes ?
58 $island->x, $island->y, 58 $island->x, $island->y,
59 $tradegoodText[$island->tradegood], 59 $tradegoodText[$island->tradegood],
60 $wonderText[$island->wonder], 60 $wonderText[$island->wonder],
61 $::server, 61 $::server,
62 $island->id, 62 $island->id,