From cb85143e63e5dc3e3b107bd10faa2e55d5258340 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 10 Mar 2019 18:38:29 +0000 Subject: [PATCH] Use $c{Sea} in a few places NFC --- generate-board | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/generate-board b/generate-board index 0e217ae..645d54c 100755 --- a/generate-board +++ b/generate-board @@ -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; -- 2.30.2