}
}
-sub get_commodmap_pctb_local () {
- my $f= new IO::File '_commodmap.tsv' or die $!;
- while (<$f>) {
- m/^(\w[^\t]+\w)\t\d+$/ or die;
- $commods{$1} .= 'b';
- }
- $f->error and die $!;
- close $f or die $!;
-}
-
sub for_commods ($) {
my ($forcommod) = @_;
foreach my $commod (sort keys %commods) { &$forcommod($commod); }
parse_masters();
get_arches_islands_pctb($ocean);
- get_commodmap_pctb_local();
+ parse_pctb_commodmap() or die;
for_islands($ocean,
sub { },
});
}
-sub main__allowablecommods ($$) {
- my ($ocean,$island) = @_;
- parse_masters();
- my $arches= $oceans{$ocean};
- if (!$arches) { print "unknown ocean\n"; exit 1; }
- my $found= 0;
- foreach my $islands (values %$arches) {
- my $sources= $islands->{$island};
- next unless $sources;
- die if $found;
- $found= $sources;
- }
- if (!$found) { print "unknown island\n"; exit 1; }
-
- print "\n";
- foreach my $commod (sort keys %commods) {
- print "$commod\n";
- }
- STDOUT->error and die $!;
- close STDOUT or die $!;
-}
-
sub main__sunshinewidget () {
print <<END
Land {On land} {