chiark / gitweb /
Use $c{Sea} in a few places
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 10 Mar 2019 18:38:29 +0000 (18:38 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 10 Mar 2019 18:38:29 +0000 (18:38 +0000)
NFC

generate-board

index 0e217ae52063365497324fee0bebbc11a203f28d..645d54c04878fc33601fa311c6befc512b1409c4 100755 (executable)
@@ -57,7 +57,7 @@ our $sre = qr{(?:(\")|(?=\w))(.*)\1$}; # 2 captures, $2 is the name
 
 sub prs2r ($) {
   # bodgery for the sea and land
-  return 'NZ' if m/ \| / && !grep { !m{^$c{OuterfaceRe}$} } split / \| /, $_[0];
+  return $c{Sea} if m/ \| / && !grep { !m{^$c{OuterfaceRe}$} } split / \| /, $_[0];
   $prs2region{$_[0]} // confess "@_ ?"
 }
 sub prs2rr ($) { $region{prs2r($_[0])} }
@@ -82,19 +82,19 @@ sub read_faces () {
   my @edges;
   my $process_rr = sub {
     my $last_ai;
-    if ($rr->{Name} eq 'NZ') {
-      # We combined L and NZ; now we must split them again
-      # in fact, we just throw away L and L2 entirely.
-      # Here, when processing NZ, we keep only vertices that
-      # are part of NZ.
+    if ($rr->{Name} eq $c{Sea}) {
+      # We combined land and sea; now we must split them again
+      # in fact, we just throw away all L entirely.
+      # Here, when processing sea, we keep only vertices that
+      # are part of the sea.
       @edges = grep {
        my $evxname = $_->{VxName};
        my @eregions = split / \| ?/, $evxname;
-       grep { $_ eq 'NZ' } @eregions
+       grep { $_ eq $c{Sea} } @eregions
       } @edges;
     }
     $rr->{Polygon} = [ @edges ];
-    if ($rr->{Name} ne 'NZ') {
+    if ($rr->{Name} ne $c{Sea}) {
       for my $ei (0..$#edges) {
        if (!defined $last_ai) {
          my $ai;