Mario/SMB.pm

filter: Statementstmt 92.8% 13 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 91.3% 21 / 23 CC 1 SCAR 1.2
CC
1
Cov
93%
games
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Mario/SMBTLL.pm ↑ Summary Mario/SMB3.pm »
1 2 ▶use 5.20.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Games::Nintendo::Mario::SMB 0.209;
4 # ABSTRACT: a class for mushroom-eating Italian plumbers
5  
6 2 ▶use parent qw(Games::Nintendo::Mario);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #pod =head1 SYNOPSIS
9 #pod
10 #pod use Games::Nintendo::Mario::SMB;
11 #pod
12 #pod my $hero = Games::Nintendo::Mario::SMB->new(
13 #pod name => 'Luigi',
14 #pod state => 'normal',
15 #pod );
16 #pod
17 #pod $hero->powerup('mushroom'); # doop doop doop!
18 #pod $hero->powerup('flower'); # change clothes
19 #pod
20 #pod $hero->damage for (1 .. 2); # cue the Mario Death Music
21 #pod
22 #pod =head1 DESCRIPTION
23 #pod
24 #pod This class subclasses Games::Nintendo::Mario, providing a model of the behavior
25 #pod of the Mario Brothers in Super Mario Brothers. All of the methods described in
26 #pod the Mario interface exist as documented.
27 #pod
28 #pod =head2 NAMES
29 #pod
30 #pod The plumber may be named Mario or Luigi.
31 #pod
32 #pod =head2 STATES
33 #pod
34 #pod The plumber's state may be any of: C<normal>, C<super>, or C<fire>
35 #pod
36 #pod =head2 POWERUPS
37 #pod
38 #pod Valid powerups are: C<mushroom> and C<flower>
39 #pod
40 #pod =method games
41 #pod
42 #pod This ruleset reflects Mario in Super Mario Bros., the original SMB game.
43 #pod
44 #pod =cut
45  
46 16 ▶sub _names { qw[Mario Luigi] }
Subroutine _names: called CC=1 SCAR=0.0
47 16 ▶sub _states { qw[normal super fire] }
Subroutine _states: called CC=1 SCAR=0.0
48 7 ▶sub _items { qw[mushroom flower] }
Subroutine _items: called CC=1 SCAR=0.0
49  
50 16 ▶sub _goto_hash {
Subroutine _goto_hash: called CC=1 SCAR=0.0
51 {
52 16 damage => {
53 normal => 'dead',
54 _else => 'normal'
55 },
56 mushroom => {
57 fire => 'fire',
58 _else => 'super',
59 },
60 flower => {
61 normal => 'super',
62 _else => 'fire'
63 }
64 }
65 }
66  
67 0 ▶sub games {
Subroutine games: not called CC=1 SCAR=6.9
Pod documented
68 0 return ('Super Mario Bros.');
69 }
70  
71 2 "It's-a me! Mario!";
72  
73 __END__
« Mario/SMBTLL.pm ↑ Summary Mario/SMB3.pm »