| 1 | package Games::Simutrans::Pak; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # Represents an individual Simutrans object (although multiple objects | ||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # may reside in an actual *.pak file). | ||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use v5.32; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 1 | our $VERSION = '0.02'; | |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 1 | ▶ | use Mojo::Base -base, -signatures; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 1 | ▶ | use Mojo::File; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 1 | ▶ | use Data::DeepAccess qw(deep_exists deep_get deep_set); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 1 | has '_intro'; | |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 1 | has '_retire'; | |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | has 'name'; | |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # | ||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # Create an object from, e.g., a dat file section. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # This requires both the text, and the pathname from which it was loaded, | ||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # in order to be able to locate the attached images. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # | ||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 3 | ▶ | sub from_string ($self, $params) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
from_string: called CC=41 SCAR=45.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 3 | my $filename; | |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | my $dat_text; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 3 | ▶ | if (ref $params) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 3 | $filename = $params->{file}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 3 | $dat_text = $params->{text}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 3 | my %this_object; | |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 3 | $this_object{_filename} = $filename; | |||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 3 | foreach my $line (split("\n", $dat_text)) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | # Remove (but save) comments | ||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 63 | ▶ | if ($line =~ s/\#(?<comment>.*)\Z//) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 3 | push @{$this_object{_comments}}, $+{comment}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | } elsif ($line =~ /^\s*-{2,}/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 1 | last; # Only load the first object. Caller is responsible for splitting *.dat files. | |||||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 62 | ▶ | if ($line =~ /^\s*(?<object>\w+)\s*(?:\[(?<subscr>(?:\[|\]|\-|\w|\s)+)\])?\s*=(?<nozoom>>?)\s*(?<value>.*?)\s*\Z/) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | # /^\s*(?<object>\w+)\s*(?:\[(?<sub1>\w+)\](?:\[(?<sub2>\w+)\])?)?\s*=\s*(?<value>.*?)\s*\Z/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 54 | my ($object, $value, $nozoom) = @+{qw(object value)}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 54 | $object = lc($object); | |||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 54 | ▶ | $this_object{_nozoom}{$object} = 1 if $+{nozoom}; # icon=>foo means foo.png without change as map is zoomed | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 54 | my @subscripts; | |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 54 | ▶ | @subscripts = split /[\[\]]+/, $+{subscr} if defined $+{subscr}; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 54 | ▶ | if (scalar @subscripts || $object =~ /^(?:cursor|icon)\z/) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
scalar @subscripts or $object =~ /^(?:cursor|icon)\z/u
MC/DC50%1/2
scalar @subscripts or $object =~ /^(?:cursor|icon)\z/u
scalar @subscripts
$object =~ /^(?:cursor|icon)\z/u
Truth table66%2/3
A or B
A= scalar @subscriptsB= $object =~ /^(?:cursor|icon)\z/u
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | # NOTE: Values with subscripts, as "value[0]=50", will clobber a previous "value=50". | ||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 24 | ▶ | if (ref(\$this_object{$object}) eq 'SCALAR') { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 3 | undef $this_object{$object}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 24 | my $is_image = 0; | |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 24 | my $dimensions; | |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 24 | ▶ | if ($object =~ /^(front|back)?(image|diagonal|start|ramp|pillar)(up)?2?\z/) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # NOTE: certain keys (FrontImage, BackImage) have multiple assumed axes, | ||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | # but not all values will give values for each; thus you may find two | ||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | # entries as: | ||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # FrontImage[1][0] = value1 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | # FrontImage[1][0][1] = value2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | # where value1 is actually for FrontImage[1][0][0][0][0][0], with all the | ||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | # unstated axes defaulting to zero. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 24 | ▶ | $dimensions = (defined $1 && $2 eq 'image') ? 6 : 2; # frontimage, backimage are 6-dim; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $1 and $2 eq "image"
MC/DC0%0/2
defined $1 and $2 eq "image"
defined $1
$2 eq "image"
Truth table33%1/3
A and B
A= defined $1B= $2 eq "image"
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # all other images are two-dimensional (one axis plus season). | ||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 24 | $is_image++; | |||||||||||||||||||||||||||||||||||||||||||||||
| 76 | } elsif ($object =~ /^((empty|freight)image|cursor|icon)\z/) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | $dimensions = 3; | |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | $is_image++; | |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 24 | ▶ | if (defined $dimensions) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 24 | ▶ | if (scalar @subscripts > $dimensions) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | print STDERR "Object " . ($this_object{name} // '??') . " has " . | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$this_object{"name"} // "??"
MC/DC0%0/1
$this_object{"name"} // "??"
$this_object{"name"}
Truth table0%0/2
A
A= $this_object{"name"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | scalar @subscripts . " ($dimensions expected)\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | # Convert to correction number of dimensions, with '0' defaults: | ||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 24 | ▶ | @subscripts = map { $_ // 0 } @subscripts[0..($dimensions-1)]; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$_ // 0
MC/DC0%0/1
$_ // 0
$_
Truth table50%1/2
A
A= $_
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 24 | ▶ | if ($is_image) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | # Can begin as './something' but otherwise file cannot have dots within | ||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 24 | ▶ | if ($value =~ /^(?<image>\.?[^.]+) | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | (?:\.(?<y>\d+) | ||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | (?:\.(?<x>\d+))? | ||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | (?:,(?<xoff>\d+) | ||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | (?:,(?<yoff>\d+))? | ||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | )? | ||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | )?/xa) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 72 | ▶ | $value = { ( map { defined $+{$_} ? ($_ => $+{$_}) : () } qw(image xoff yoff) ), # skip each if undef | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 24 | ▶ | ( map { $_ => $+{$_} // 0 } qw( x y ) ) }; # these default to zero | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$+{$_} // 0
MC/DC0%0/1
$+{$_} // 0
$+{$_}
Truth table50%1/2
A
A= $+{$_}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | # Override above in case of older "imagefile.3" form, which assumes column (x) only | ||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 24 | ▶ | if (!defined $+{x} && $object =~ /^(front|back|empty|freight)/) { # | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $+{"x"} and $object =~ /^(front|back|empty|freight)/u
MC/DC0%0/2
not defined $+{"x"} and $object =~ /^(front|back|empty|freight)/u
not defined $+{"x"}
$object =~ /^(front|back|empty|freight)/u
Truth table33%1/3
not(A) and B
A= not defined $+{"x"}B= $object =~ /^(front|back|empty|freight)/u
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | $value->{x} = $+{y} // 0; $value->{y} = 0; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$+{"y"} // 0
MC/DC0%0/1
$+{"y"} // 0
$+{"y"}
Truth table0%0/2
A
A= $+{"y"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 24 | ▶ | $value->{imagefile} = Mojo::File->new($filename)->sibling($value->{image}.'.png') unless $value->{image} eq '-'; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 24 | $this_object{_hasimages}{$object}++; | |||||||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | # for Data::DeepAccess … Thanks mst and Grinnz on irc.perl.org #perl 2020-06-18 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | 24 | deep_set(\%this_object, $object, (map { lc } (@subscripts)), $value); | |||||||||||||||||||||||||||||||||||||||||||||||
| 109 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 30 | $this_object{lc($object)} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | # Finalization | ||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 3 | ▶ | if (! $this_object{intro_year} && ! $this_object{retire_year}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$this_object{'intro_year'} || $this_object{'retire_year'}
MC/DC0%0/2
$this_object{'intro_year'} || $this_object{'retire_year'}
$this_object{'intro_year'}
$this_object{'retire_year'}
Truth table33%1/3
A || B
A= $this_object{'intro_year'}B= $this_object{'retire_year'}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | $this_object{_is_permanent} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | $this_object{_sort_key} = '0000'; | |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 3 | ▶ | $this_object{intro_year} ||= 1000; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$this_object{"intro_year"} ||= 1000
MC/DC0%0/1
$this_object{"intro_year"} ||= 1000
$this_object{"intro_year"}
Truth table50%1/2
A
A= $this_object{"intro_year"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 3 | ▶ | $this_object{intro_month} ||= 1; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$this_object{"intro_month"} ||= 1
MC/DC0%0/1
$this_object{"intro_month"} ||= 1
$this_object{"intro_month"}
Truth table50%1/2
A
A= $this_object{"intro_month"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 3 | ▶ | $this_object{retire_year} ||= 2999; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$this_object{"retire_year"} ||= 2999
MC/DC0%0/1
$this_object{"retire_year"} ||= 2999
$this_object{"retire_year"}
Truth table50%1/2
A
A= $this_object{"retire_year"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 3 | ▶ | $this_object{retire_month} ||= 12; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$this_object{"retire_month"} ||= 12
MC/DC0%0/1
$this_object{"retire_month"} ||= 12
$this_object{"retire_month"}
Truth table50%1/2
A
A= $this_object{"retire_month"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 3 | $this_object{_is_internal} = $this_object{intro_year} < 100; # Internal object | |||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | # Permit second-level sorting for objects with equal introductory times | ||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 3 | my $power = $this_object{'engine_type'}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 3 | ▶ | $power = '~~~' if (!length($power)); # sort last | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | $this_object{_sort_key} = sprintf("%4d.%02d %s %4d.%02d", | ||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | $this_object{'intro_year'}, $this_object{'intro_month'}, | ||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | $power, | ||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 3 | $this_object{'retire_year'}, $this_object{'retire_month'}); | |||||||||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | ###### OBSOLETE | ||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | # # Abbreviate loquacious names | ||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | # $this_object{_short_name} = $this_object{'name'} // '(none)'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # if (length($this_object{_short_name}) > 30) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | # $this_object{_short_name} =~ s/-([^-]{3})[^-]+/-$1/g; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | # en-passant spelling correction | ||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 3 | ▶ | $this_object{max_length} //= delete $this_object{max_lenght} if defined $this_object{max_lenght}; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$this_object{"max_length"} //= delete $this_object{"max_lenght"}
MC/DC0%0/2
$this_object{"max_length"} //= delete $this_object{"max_lenght"}
$this_object{"max_length"}
delete $this_object{"max_lenght"}
Truth table0%0/3
A //= B
A= $this_object{"max_length"}B= delete $this_object{"max_lenght"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 3 | ▶ | if (exists $this_object{intro_year}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | foreach my $event (qw[intro retire]) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 6 | foreach my $period (qw[month year]) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 12 | my $setit = $event . '_' . $period; | |||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 12 | $self->$setit (delete $this_object{$setit}); | |||||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | # TODO: Suppress trailing zero dimensions in image hashes/arrays. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | # Copy values into returned (self) object | ||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 3 | foreach my $k (keys %this_object) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 42 | $self->{$k} = $this_object{$k}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 3 | ▶ | return defined $this_object{obj} ? $self : undef; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 23 | ▶ | sub intro ($self) { return $self->_intro; } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intro: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 22 | ▶ | sub retire ($self) { return $self->_retire; } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
retire: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 7 | ▶ | sub intro_year ($self, $value = undef) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intro_year: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 7 | ▶ | $self->_intro( $value * 12 + (($self->intro() // 0) % 12) ) if defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->intro // 0
MC/DC0%0/1
$self->intro // 0
$self->intro
Truth table50%1/2
A
A= $self->intro
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 7 | ▶ | return defined $self->intro() ? int($self->intro() / 12) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 4 | ▶ | sub intro_month ($self, $value = undef) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
intro_month: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 4 | ▶ | $self->_intro( (($self->intro_year() // 0) * 12) + $value - 1) if defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->intro_year // 0
MC/DC0%0/1
$self->intro_year // 0
$self->intro_year
Truth table50%1/2
A
A= $self->intro_year
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 4 | ▶ | return defined $self->intro() ? ($self->intro() % 12) + 1 : undef; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | 7 | ▶ | sub retire_year ($self, $value = undef) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
retire_year: called CC=5 SCAR=16.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 7 | ▶ | $self->_retire( $value * 12 + (($self->retire() // 0) % 12) ) if defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->retire // 0
MC/DC0%0/1
$self->retire // 0
$self->retire
Truth table50%1/2
A
A= $self->retire
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 7 | ▶ | return defined $self->retire() ? int($self->retire() / 12) : undef; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 4 | ▶ | sub retire_month ($self, $value = undef) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
retire_month: called CC=5 SCAR=16.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 4 | ▶ | $self->_retire( (($self->retire_year() // 0) * 12) + $value - 1) if defined $value; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
$self->retire_year // 0
MC/DC0%0/1
$self->retire_year // 0
$self->retire_year
Truth table50%1/2
A
A= $self->retire_year
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 4 | ▶ | return defined $self->retire() ? ($self->retire() % 12) + 1 : undef; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | sub waytype_text ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
waytype_text: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | # Return a standardized, shorter version of the waytype | ||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my $waytype = $self->{'waytype'}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | if (defined $waytype) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $waytype =~ s/_track//; | |||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | $waytype =~ s/track/train/; | |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | $waytype =~ s/water/ship/; | |||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | $waytype =~ s/narrowgauge/narrow/; | |||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | ▶ | return $waytype // ''; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$waytype // ""
MC/DC0%0/1
$waytype // ""
$waytype
Truth table0%0/2
A
A= $waytype
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | sub payload_text ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
payload_text: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | # Return a standardized, shorter version of the capacities (from the payload) | ||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my $capacity; | |||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if ( defined $self->{payload} ) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | if ( ref $self->{payload} eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | $capacity = join(',', $self->{payload}->@{ sort keys %{$self->{payload}} } ); | |||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | $capacity = sprintf("%3du", $self->{payload}); | |||||||||||||||||||||||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | return $capacity // '--'; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$capacity // "--"
MC/DC0%0/1
$capacity // "--"
$capacity
Truth table0%0/2
A
A= $capacity
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | ################ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 2 | ▶ | sub comments ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
comments: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | 2 | return $self->{_comments}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 37 | ▶ | sub deep_print ($self, $attribute, @keys) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
deep_print: called CC=13 SCAR=27.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | 37 | my $value = deep_get($self->{$attribute}, @keys); | |||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 37 | ▶ | if (ref $value eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 29 | my $text; | |||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 29 | my $has_values = []; | |||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 29 | ▶ | my $is_image = exists $value->{image} && exists $value->{x}; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
exists $value->{'image'} && exists $value->{'x'}
MC/DC50%1/2
exists $value->{'image'} && exists $value->{'x'}
exists $value->{'image'}
exists $value->{'x'}
Truth table66%2/3
A && B
A= exists $value->{'image'}B= exists $value->{'x'}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 29 | foreach my $k (sort keys %{$value}) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 60 | ▶ | if ($is_image && !ref deep_get($self->{$attribute}, @keys, $k)) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$is_image and not ref deep_get($self->{$attribute}, @keys, $k)
MC/DC100%2/2
$is_image and not ref deep_get($self->{$attribute}, @keys, $k)
$is_image
not ref deep_get($self->{$attribute}, @keys, $k)
Truth table100%3/3
A and not(B)
A= $is_imageB= not ref deep_get($self->{$attribute}, @keys, $k)
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 24 | push @{$has_values}, $k; | |||||||||||||||||||||||||||||||||||||||||||||||
| 240 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 36 | $text .= $self->deep_print($attribute, @keys, $k); | |||||||||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 29 | ▶ | if (scalar @{$has_values}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | # TODO: Only if this is an image! | ||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | my $image_spec = $value->{image} . | ||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | '.' . ($value->{y}//0) . | ||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 8 | ▶ | '.' . ($value->{x}//0); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$value->{"y"} // 0
$value->{"x"} // 0
MC/DC0%0/1
$value->{"y"} // 0
$value->{"y"}
MC/DC0%0/1
$value->{"x"} // 0
$value->{"x"}
Truth table50%1/2
A
A= $value->{"y"}
Truth table50%1/2
A
A= $value->{"x"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | $image_spec .= ',' . ($value->{xoff}//0) . ',' . ($value->{yoff}//0) | ||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 8 | ▶ | if defined $value->{xoff} || $value->{yoff}; | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition14%1/7
defined $value->{"xoff"} or $value->{"yoff"}
$value->{"xoff"} // 0
$value->{"yoff"} // 0
MC/DC0%0/2
defined $value->{"xoff"} or $value->{"yoff"}
defined $value->{"xoff"}
$value->{"yoff"}
MC/DC0%0/1
$value->{"xoff"} // 0
$value->{"xoff"}
MC/DC0%0/1
$value->{"yoff"} // 0
$value->{"yoff"}
Truth table33%1/3
A or B
A= defined $value->{"xoff"}B= $value->{"yoff"}
Truth table0%0/2
A
A= $value->{"xoff"}
Truth table0%0/2
A
A= $value->{"yoff"}
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 8 | return $attribute . '[' . join('][', @keys) . ']=' . $image_spec . "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | 21 | return $text; | |||||||||||||||||||||||||||||||||||||||||||||||
| 254 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 8 | return $attribute . '[' . join('][', @keys) . ']=' . $value . "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | 1 | ▶ | sub to_string ($self) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
to_string: called CC=7 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | # Preferred order to emit attributes. Any others will be emitted | ||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | # in random order after these. | ||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 1 | my $emit_order = Mojo::Collection->new(qw( obj type name copyright | |||||||||||||||||||||||||||||||||||||||||||||||
| 263 | intro_year intro_month retire_year retire_month | ||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | waytype own_waytype engine_type chance DistributionWeight | ||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | needs_ground seasons climates | ||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | noinfo noconstruction | ||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | build_time level offset_left | ||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | enables_pax enables_post enables_ware | ||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | catg metric weight_per_unit value speed_bonus | ||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | freight payload speed topspeed cost maintenance runningcost | ||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | power gear height weight length sound smoke | ||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | loading_time | ||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | max_length max_height pillar_distance pillar_asymmetric system_type | ||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | MapColor | ||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | dims | ||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | icon cursor | ||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | FrontImage BackImage BackImage2 | ||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | FreightImageType FreightImage EmptyImage | ||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | openimage front_openimage closedimage front_closedimage | ||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | )); | ||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 1 | my %to_emit = map { ($_, $self->{$_}) } grep { $_ !~ /^_/ } keys %{$self}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | # Replace synthetic dates with external representations | ||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 1 | ▶ | if (defined $self->intro()) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 1 | @to_emit{qw(intro_year intro_month retire_year retire_month)} = | |||||||||||||||||||||||||||||||||||||||||||||||
| 286 | ($self->intro_year(), $self->intro_month(), $self->retire_year(), $self->retire_month()); | ||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 1 | my $text = ''; | |||||||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | 1 | ▶ | foreach my $c (@{$self->comments // []}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$self->comments // []
MC/DC0%0/1
$self->comments // []
$self->comments
Truth table50%1/2
A
A= $self->comments
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 1 | $text .= "#$c\n"; | |||||||||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | # Emit common attributes in a desirable order | ||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 63 | ▶ | $emit_order->each(sub { my $emit_key = lc($_); # %to_emit has keys from object, not as capitalized above | ||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 63 | ▶ | if (defined $to_emit{$emit_key}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 13 | ▶ | if (ref $self->{$emit_key} ne 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 12 | $text .= "$_=" . $to_emit{$emit_key} . "\n"; # simple value | |||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 1 | $text .= $self->deep_print($emit_key); | |||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 13 | delete $to_emit{$emit_key}; | |||||||||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 1 | }); | |||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 1 | $text .= "\n"; | |||||||||||||||||||||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | # Emit remaining attributes | ||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 1 | foreach my $k (sort keys %to_emit) { | |||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | if (defined $self->{$k}) { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | if (ref $self->{$k} ne 'HASH') { | ||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | 0 | $text .= "$k=" . $self->{$k} . "\n"; # simple value | |||||||||||||||||||||||||||||||||||||||||||||||
| 312 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $text .= $self->deep_print($k); | |||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 1 | return $text . "------\n\n"; | |||||||||||||||||||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||