blib/lib/Games/RolePlay/MapGen/Generator/Basic.pm

filter: Statementstmt 100% 189 / 189 Branchbran 89.5% 77 / 86 Conditioncond 90.4% 38 / 42 MC/DCmcdc 82.1% 23 / 28 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 5 totaltotal 93.5% 336 / 359 CC 78 SCAR 34.4
CC
78
Cov
96%
drop_rooms
46.3
mark_things_as_pseudo_rooms
19.0
cleanup_pseudo_rooms
13.0
CRAP 31.1
« blib/lib/Games/RolePlay/MapGen/Generator/OneBigRoom.pm ↑ Summary blib/lib/Games/RolePlay/MapGen/Exporter/Text.pm »
1 # vi:tw=0 syntax=perl:
2  
3 package Games::RolePlay::MapGen::Generator::Basic;
4  
5 8 ▶use common::sense;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 8 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 8 ▶use parent q(Games::RolePlay::MapGen::Generator::SparseAndLoops);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 8 ▶use Games::RolePlay::MapGen::Tools qw( choice roll _group irange str_eval );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 8 1;
11  
12 # gen_room_size {{{
13 30 ▶sub gen_room_size {
Subroutine gen_room_size: called CC=3 SCAR=11.3
Pod undocumented
14 30 my $this = shift;
15 30 my $opts = shift;
16
17 30 my ($xm, $ym) = split /x/, $opts->{min_room_size};
18 30 my ($xM, $yM) = split /x/, $opts->{max_room_size};
19  
20 30 my $x = irange($xm, $xM);
21 30 my $y = irange($ym, $yM);
22  
23 30 ▶ die "ERROR: problem generating room size from '$opts->{min_room_size} - $opts->{max_room_size}'" unless $x>0 and $y>0;
Branch: 1 branch
BranchTrueFalseTotal
unless $x > 0 and $y > 0 0 30 30
Condition33%1/3
$x > 0 and $y > 0
!ll&&!rl&&r
0030
MC/DC0%0/2
$x > 0 and $y > 0
$x > 0 $y > 0
Truth table33%1/3
A and B
A= $x > 0B= $y > 0
ABresult
0X0
100
111
24  
25 30 return ($x, $y);
26 }
27 # }}}
28  
29 # mark_things_as_pseudo_rooms {{{
30 8 ▶sub mark_things_as_pseudo_rooms {
Subroutine mark_things_as_pseudo_rooms: called CC=19 SCAR=29.4
Pod undocumented
31 8 my $this = shift;
32 8 my $map = shift;
33 8 my $groups = shift;
34  
35 # This function assumes all defined {type}s are corridoors and that all {od} are un-broken.
36  
37 8 for my $tile ( map(@$_, @$map) ) {
38 3800 ▶ if( $tile->{type} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tile->{"type"}) 1159 2641 3800
39  
40 # Look for those 2x2 corridor-loops starting with familiar upper left corner tiles.
41 1159 ▶ if( $tile->{od}{e} and $tile->{od}{s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tile->{"od"}{"e"} and $tile->{"od"}{"s"}) 129 1030 1159
Condition100%3/3
$tile->{"od"}{"e"} and $tile->{"od"}{"s"}
!ll&&!rl&&r
589441129
MC/DC100%2/2
$tile->{"od"}{"e"} and $tile->{"od"}{"s"}
$tile->{"od"}{"e"} $tile->{"od"}{"s"}
Truth table100%3/3
A and B
A= $tile->{"od"}{"e"}B= $tile->{"od"}{"s"}
ABresult
0X0
100
111
42 129 my $ul = $tile;
43 129 my $ur = $tile->{nb}{e};
44 129 my $ll = $tile->{nb}{s};
45  
46 129 ▶ if( $ur->{od}{s} and $ll->{od}{e} ) {
Branch: 3 branches
BranchTrueFalseTotal
if ($ur->{'od'}{'s'} and $ll->{'od'}{'e'}) { } 17 112 129
elsif (+(my $um = $ur)->{'od'}{'e'} and $ll->{'od'}{'e'}) { } 8 104 112
elsif (+(my $ml = $ll)->{'od'}{'s'} and $ur->{'od'}{'s'}) { } 12 120 132
Condition100%3/3
$ur->{"od"}{"s"} and $ll->{"od"}{"e"}
!ll&&!rl&&r
971517
MC/DC100%2/2
$ur->{"od"}{"s"} and $ll->{"od"}{"e"}
$ur->{"od"}{"s"} $ll->{"od"}{"e"}
Truth table100%3/3
A and B
A= $ur->{"od"}{"s"}B= $ll->{"od"}{"e"}
ABresult
0X0
100
111
47 17 my $lr = $ur->{nb}{s};
48  
49 17 my $group = &_group;
50 17 $group->type("pseudo");
51 17 $group->add_rectangle([$ul->{x}, $ul->{y}], [2,2]);
52  
53 17 for( $ul, $ur, $ll, $lr) {
54 # $_->{DEBUG_red_mark} = 1;
55 68 $_->{group} = $group;
56 68 $_->{type} = $group->{type};
57 }
58  
59 ▶ } elsif( (my $um = $ur)->{od}{e} and $ll->{od}{e} ) {
Condition100%3/3
+(my $um = $ur)->{"od"}{"e"} and $ll->{"od"}{"e"}
!ll&&!rl&&r
32728
MC/DC100%2/2
+(my $um = $ur)->{"od"}{"e"} and $ll->{"od"}{"e"}
+(my $um = $ur)->{"od"}{"e"} $ll->{"od"}{"e"}
Truth table100%3/3
A and B
A= +(my $um = $ur)->{"od"}{"e"}B= $ll->{"od"}{"e"}
ABresult
0X0
100
111
60 8 $ur = $um->{nb}{e};
61 8 my $lm = $ll->{nb}{e};
62  
63 8 ▶ if( $lm->{od}{e} and $ur->{od}{s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($lm->{"od"}{"e"} and $ur->{"od"}{"s"}) 2 6 8
Condition66%2/3
$lm->{"od"}{"e"} and $ur->{"od"}{"s"}
!ll&&!rl&&r
062
MC/DC50%1/2
$lm->{"od"}{"e"} and $ur->{"od"}{"s"}
$lm->{"od"}{"e"} $ur->{"od"}{"s"}
Truth table66%2/3
A and B
A= $lm->{"od"}{"e"}B= $ur->{"od"}{"s"}
ABresult
0X0
100
111
64 2 my $lr = $lm->{nb}{e};
65  
66 2 my $group = &_group;
67 2 $group->type("pseudo");
68 2 $group->add_rectangle([$ul->{x}, $ul->{y}], [3,2]);
69  
70 2 for( $ul, $um, $ur,
71 $ll, $lm, $lr ) {
72  
73 # $_->{DEBUG_blue_mark} = 1;
74 12 $_->{group} = $group;
75 12 $_->{type} = $group->{type};
76 }
77  
78 }
79  
80 ▶ } elsif( (my $ml = $ll)->{od}{s} and $ur->{od}{s} ) {
Condition100%3/3
+(my $ml = $ll)->{"od"}{"s"} and $ur->{"od"}{"s"}
!ll&&!rl&&r
286412
MC/DC100%2/2
+(my $ml = $ll)->{"od"}{"s"} and $ur->{"od"}{"s"}
+(my $ml = $ll)->{"od"}{"s"} $ur->{"od"}{"s"}
Truth table100%3/3
A and B
A= +(my $ml = $ll)->{"od"}{"s"}B= $ur->{"od"}{"s"}
ABresult
0X0
100
111
81 12 $ll = $ml->{nb}{s};
82 12 my $mr = $ur->{nb}{s};
83  
84 12 ▶ if( $ll->{od}{e} and $mr->{od}{s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ll->{"od"}{"e"} and $mr->{"od"}{"s"}) 2 10 12
Condition100%3/3
$ll->{"od"}{"e"} and $mr->{"od"}{"s"}
!ll&&!rl&&r
732
MC/DC100%2/2
$ll->{"od"}{"e"} and $mr->{"od"}{"s"}
$ll->{"od"}{"e"} $mr->{"od"}{"s"}
Truth table100%3/3
A and B
A= $ll->{"od"}{"e"}B= $mr->{"od"}{"s"}
ABresult
0X0
100
111
85 2 my $lr = $ll->{nb}{e};
86  
87 2 my $group = &_group;
88 2 $group->type("pseudo");
89 2 $group->add_rectangle([$ul->{x}, $ul->{y}], [2,3]);
90  
91 2 for( $ul, $ur,
92 $ml, $mr,
93 $ll, $lr ) {
94  
95 # $_->{DEBUG_blue_mark} = 1;
96 12 $_->{group} = $group;
97 12 $_->{type} = $group->{type};
98 }
99  
100 }
101 }
102 }
103 }
104 }
105  
106 8 push @$groups, map($_->{group}, grep {$_->{group}} map(@$_, @$map));
107 8 for my $g (@$groups) {
108 92 $g->{lsize} = $g->enumerate_tiles;
109 }
110 }
111 # }}}
112 # drop_rooms {{{
113 8 ▶sub drop_rooms {
Subroutine drop_rooms: called CC=46 SCAR=38.4
Pod undocumented
114 8 my $this = shift;
115 8 my $opts = shift;
116 8 my $map = shift;
117 8 my $groups = shift;
118  
119 8 $opts->{y_size} = $#$map;
120 8 $opts->{x_size} = $#{ $map->[0] };
121  
122 8 for my $rn (1 .. str_eval( $opts->{num_rooms} )) {
123 30 my @size = $this->gen_room_size( $opts );
124 30 ▶ $size[0] = $opts->{x_size} if $size[0] > $opts->{x_size};
Branch: 1 branch
BranchTrueFalseTotal
if $size[0] > $opts->{"x_size"} 0 30 30
125 30 ▶ $size[1] = $opts->{y_size} if $size[1] > $opts->{y_size};
Branch: 1 branch
BranchTrueFalseTotal
if $size[1] > $opts->{"y_size"} 0 30 30
126  
127 30 my @possible_locs = (); # [ $j, $i, $score ]
128 30 my $lowest_score = undef;
129  
130 30 ▶ $opts->{t_cb}->() if exists $opts->{t_cb};
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"t_cb"} 0 30 30
131  
132 30 for my $i (0 .. $#$map - $size[1]) {
133 504 my $jend = $#{ $map->[$i] };
134  
135 504 for my $j (0 .. $jend - $size[0]) {
136  
137 9110 my $score = 0;
138 9110 my $pseudo = 0;
139 9110 for my $x (0 .. $size[0]-1) {
140 35076 for my $y (0 .. $size[1]-1) {
141 155151 my $tile = $map->[$i+$y][$j+$x];
142  
143 155151 ▶ if( exists $tile->{type} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $tile->{"type"}) 55239 99912 155151
144 55239 ▶ goto LONGJUMP_PAST_SCORING if $tile->{type} eq "room";
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"type"} eq "room" 1758 53481 55239
145  
146 53481 ▶ if( $tile->{type} eq "corridor" ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($tile->{'type'} eq 'corridor') { } 51275 2206 53481
elsif ($tile->{'type'} eq 'pseudo') { } 2206 0 2206
147 51275 $score += 1.07;
148  
149 } elsif( $tile->{type} eq "pseudo" ) {
150 2206 $tile->{group}{_rd_all} ++;
151  
152 2206 $pseudo = 1;
153 }
154 }
155 }
156 }
157  
158 7352 ▶ if( $pseudo ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($pseudo) 800 6552 7352
159 800 for my $g (grep { $_->{type} eq "pseudo" } @$groups) {
160 14658 ▶ if( exists $g->{_rd_all} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $g->{"_rd_all"}) 822 13836 14658
161  
162 822 ▶ if( $g->{_rd_all} == $g->{lsize} ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($g->{'_rd_all'} == $g->{'lsize'}) { } 268 554 822
elsif ($g->{'lsize'} == 6 and $g->{'_rd_all'} == 4) { } 33 521 554
163 268 ▶ $score += ( $g->{lsize} == 6 ? 1.01 : 1.03 );
Branch: 1 branch
BranchTrueFalseTotal
$g->{'lsize'} == 6 ? : 27 241 268
164  
165 ▶ } elsif( $g->{lsize} == 6 and $g->{_rd_all} == 4 ) {
Condition100%3/3
$g->{"lsize"} == 6 and $g->{"_rd_all"} == 4
!ll&&!rl&&r
4328933
MC/DC100%2/2
$g->{"lsize"} == 6 and $g->{"_rd_all"} == 4
$g->{"lsize"} == 6 $g->{"_rd_all"} == 4
Truth table100%3/3
A and B
A= $g->{"lsize"} == 6B= $g->{"_rd_all"} == 4
ABresult
0X0
100
111
166 33 $score += 1.05;
167  
168 } else {
169 521 $score += 1.07 * 4;
170  
171 }
172  
173 822 delete $g->{_rd_all};
174 822 $pseudo = 0;
175 }
176 }
177 }
178  
179 7352 ▶ if( $score > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($score > 0) 6507 845 7352
180 6507 ▶ if( not defined $lowest_score or $score < $lowest_score ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $lowest_score or $score < $lowest_score) 137 6370 6507
Condition100%3/3
not defined $lowest_score or $score < $lowest_score
l!l&&r!l&&!r
301076370
MC/DC100%2/2
not defined $lowest_score or $score < $lowest_score
not defined $lowest_score $score < $lowest_score
Truth table100%3/3
not(A) or B
A= not defined $lowest_scoreB= $score < $lowest_score
ABresult
1X1
011
000
181 137 $lowest_score = $score;
182 137 @possible_locs = grep { $_->[2] <= $lowest_score } @possible_locs;
183 }
184  
185 6507 ▶ push @possible_locs, [ $j, $i, $score ] if $score <= $lowest_score;
Branch: 1 branch
BranchTrueFalseTotal
if $score <= $lowest_score 352 6155 6507
186 }
187  
188 LONGJUMP_PAST_SCORING:
189 # This is a way of short-cutting much looping when we're not
190 # going to be putting the room there anyway.
191 9110 }
192 }
193  
194 30 ▶ if( my $loc = choice( @possible_locs ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $loc = choice(@possible_locs)) 30 0 30
195 30 my @corridors = ();
196  
197 30 pop @$loc; # ditch the score.
198  
199 30 my $group = &_group;
200 30 $group->name( "Room #$rn" );
201 30 $group->type( "room" );
202 30 $group->add_rectangle( [@$loc], [@size] );
203  
204 30 my @tiles = $group->enumerate_tiles;
205 30 my ($xmin, $ymin, $xmax, $ymax) = $group->enumerate_extents;
206  
207 30 for my $tl ( @tiles ) {
208 630 my ($x,$y) = @$tl;
209 630 my $tile = $map->[ $y ][ $x ];
210  
211 630 ▶ if( exists $tile->{type} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $tile->{"type"}) 106 524 630
212 106 ▶ if( $tile->{type} eq "corridor" or $tile->{type} eq "pseudo" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tile->{"type"} eq "corridor" or $tile->{"type"} eq "pseudo") 106 0 106
Condition66%2/3
$tile->{"type"} eq "corridor" or $tile->{"type"} eq "pseudo"
l!l&&r!l&&!r
54520
MC/DC0%0/2
$tile->{"type"} eq "corridor" or $tile->{"type"} eq "pseudo"
$tile->{"type"} eq "corridor" $tile->{"type"} eq "pseudo"
Truth table66%2/3
A or B
A= $tile->{"type"} eq "corridor"B= $tile->{"type"} eq "pseudo"
ABresult
1X1
011
000
213 106 ▶ push @corridors, [ w => $tile ] if $x == $xmin and $tile->{od}{w};
Branch: 1 branch
BranchTrueFalseTotal
if $x == $xmin and $tile->{"od"}{"w"} 14 92 106
Condition100%3/3
$x == $xmin and $tile->{"od"}{"w"}
!ll&&!rl&&r
771514
MC/DC100%2/2
$x == $xmin and $tile->{"od"}{"w"}
$x == $xmin $tile->{"od"}{"w"}
Truth table100%3/3
A and B
A= $x == $xminB= $tile->{"od"}{"w"}
ABresult
0X0
100
111
214 106 ▶ push @corridors, [ n => $tile ] if $y == $ymin and $tile->{od}{n};
Branch: 1 branch
BranchTrueFalseTotal
if $y == $ymin and $tile->{"od"}{"n"} 9 97 106
Condition100%3/3
$y == $ymin and $tile->{"od"}{"n"}
!ll&&!rl&&r
73249
MC/DC100%2/2
$y == $ymin and $tile->{"od"}{"n"}
$y == $ymin $tile->{"od"}{"n"}
Truth table100%3/3
A and B
A= $y == $yminB= $tile->{"od"}{"n"}
ABresult
0X0
100
111
215 106 ▶ push @corridors, [ e => $tile ] if $x == $xmax and $tile->{od}{e};
Branch: 1 branch
BranchTrueFalseTotal
if $x == $xmax and $tile->{"od"}{"e"} 15 91 106
Condition100%3/3
$x == $xmax and $tile->{"od"}{"e"}
!ll&&!rl&&r
771415
MC/DC100%2/2
$x == $xmax and $tile->{"od"}{"e"}
$x == $xmax $tile->{"od"}{"e"}
Truth table100%3/3
A and B
A= $x == $xmaxB= $tile->{"od"}{"e"}
ABresult
0X0
100
111
216 106 ▶ push @corridors, [ s => $tile ] if $y == $ymax and $tile->{od}{s};
Branch: 1 branch
BranchTrueFalseTotal
if $y == $ymax and $tile->{"od"}{"s"} 12 94 106
Condition100%3/3
$y == $ymax and $tile->{"od"}{"s"}
!ll&&!rl&&r
791512
MC/DC100%2/2
$y == $ymax and $tile->{"od"}{"s"}
$y == $ymax $tile->{"od"}{"s"}
Truth table100%3/3
A and B
A= $y == $ymaxB= $tile->{"od"}{"s"}
ABresult
0X0
100
111
217 }
218 }
219  
220 630 $tile->{type} = "room";
221 630 $tile->{group} = $group;
222 630 for my $dir (qw(n e s w)) {
223 2520 $tile->{od}{$dir} = 1; # open every direction... close edges below
224  
225 2520 ▶ if( my $n = $tile->{nb}{$dir} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $n = $tile->{"nb"}{$dir}) 2474 46 2520
226 2474 $n->{od}{$Games::RolePlay::MapGen::opp{$dir}} = 1;
227 }
228 }
229 # $tile->{DEBUG_green_mark} = 1;
230 }
231  
232 30 for my $y ($ymin .. $ymax) {
233 136 (my $west = $map->[$y][ $xmin ])->{od}{w} = 0;
234 136 (my $east = $map->[$y][ $xmax ])->{od}{e} = 0;
235  
236 136 ▶ if( my $west_n = $west->{nb}{w} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $west_n = $west->{"nb"}{"w"}) 103 33 136
237 103 $west_n->{od}{e} = 0;
238 }
239  
240 136 ▶ if( my $east_n = $east->{nb}{e} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $east_n = $east->{"nb"}{"e"}) 136 0 136
241 136 $east_n->{od}{w} = 0;
242 }
243 }
244  
245 30 for my $x ($xmin .. $xmax) {
246 136 (my $north = $map->[ $ymin ][$x])->{od}{n} = 0;
247 136 (my $south = $map->[ $ymax ][$x])->{od}{s} = 0;
248  
249 136 ▶ if( my $north_n = $north->{nb}{n} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $north_n = $north->{"nb"}{"n"}) 123 13 136
250 123 $north_n->{od}{s} = 0;
251 }
252  
253 136 ▶ if( my $south_n = $south->{nb}{s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $south_n = $south->{"nb"}{"s"}) 136 0 136
254 136 $south_n->{od}{n} = 0;
255 }
256 }
257  
258 # By default, tiles will be open between the new rooms and the corridors they stomped
259 30 for my $a (@corridors) {
260 50 my $t = $a->[1];
261 50 my $n = $t->{nb}{$a->[0]};
262  
263 50 $t->{od}{$a->[0]} = $n->{od}{$Games::RolePlay::MapGen::opp{$a->[0]}} = 1;
264 }
265  
266 30 push @$groups, $group;
267 }
268  
269 }
270 }
271 # }}}
272 # cleanup_pseudo_rooms {{{
273 8 ▶sub cleanup_pseudo_rooms {
Subroutine cleanup_pseudo_rooms: called CC=13 SCAR=25.6
Pod undocumented
274 8 my $this = shift;
275 8 my $map = shift;
276 8 my $groups = shift;
277 8 my @pseudo = ();
278  
279 8 ▶ @$groups = grep { my $r = 1; if( $_->{type} eq "pseudo" ) { push @pseudo, $_; $r = 0 } $r } @$groups;
Branch: 1 branch
BranchTrueFalseTotal
if ($_->{"type"} eq "pseudo") 92 30 122
280  
281 8 for my $group (@pseudo) {
282  
283 92 my $intact = 1;
284 92 my @tofix = ();
285 92 for my $tl ($group->enumerate_tiles) {
286 416 my $tile = $map->[$tl->[1]][$tl->[0]];
287  
288 # $tile->{DEBUG_red_mark} = 1;
289  
290 416 ▶ if( $tile->{type} eq "pseudo" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tile->{'type'} eq 'pseudo') { } 40 376 416
291 40 $tile->{type} = "corridor";
292 40 push @tofix, $tile;
293  
294 } else {
295 376 $intact = 0;
296 }
297 }
298  
299 92 my ($xmin, $ymin, $xmax, $ymax) = $group->enumerate_extents;
300 92 ▶ if( $intact ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($intact) 10 82 92
301 10 for my $tile (@tofix) {
302 40 ▶ $tile->{od}{n} = 1 if $tile->{y} > $ymin;
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"y"} > $ymin 20 20 40
303 40 ▶ $tile->{od}{s} = 1 if $tile->{y} < $ymax;
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"y"} < $ymax 20 20 40
304 40 ▶ $tile->{od}{e} = 1 if $tile->{x} < $xmax;
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"x"} < $xmax 20 20 40
305 40 ▶ $tile->{od}{w} = 1 if $tile->{x} > $xmin;
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"x"} > $xmin 20 20 40
306 }
307 }
308 }
309  
310 8 for my $tile (grep {$_->{group}} map {@$_} @$map) {
311 delete $tile->{group}
312 670 ▶ if $tile->{group}{type} eq "pseudo";
Branch: 1 branch
BranchTrueFalseTotal
if $tile->{"group"}{"type"} eq "pseudo" 40 630 670
313 }
314 }
315 # }}}
316  
317 # genmap {{{
318 8 ▶sub genmap {
Subroutine genmap: called CC=1 SCAR=0.0
Pod undocumented
319 8 my $this = shift;
320 8 my $opts = $this->gen_opts(%{ $_[0] });
321 8 my ($map, $groups) = $this->SUPER::genmap(@_);
322  
323 # There are a few types of random corridors that look enough like rooms
324 # That I didn't think they should count against the room drop score below.
325 # In fact, we'd really rather cover them up if possible.
326 8 $this->mark_things_as_pseudo_rooms( $map, $groups );
327 8 $this->drop_rooms( $opts, $map, $groups );
328 8 $this->cleanup_pseudo_rooms( $map, $groups );
329  
330 8 return ($map, $groups);
331 }
332 # }}}
333  
334 __END__
« blib/lib/Games/RolePlay/MapGen/Generator/OneBigRoom.pm ↑ Summary blib/lib/Games/RolePlay/MapGen/Exporter/Text.pm »