From: Ian Jackson Date: Sun, 10 Mar 2019 18:38:29 +0000 (+0000) Subject: Use $c{Sea} in a few places X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=cb85143e63e5dc3e3b107bd10faa2e55d5258340;p=pandemic-rising-tide.git Use $c{Sea} in a few places NFC --- 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;