File Coverage

blib/lib/Games/Nintendo/Mario/SMB3.pm
Criterion Covered Total %
statement 12 13 92.3
branch n/a
condition n/a
subroutine 7 8 87.5
pod 1 1 100.0
total 20 22 90.9


line stmt bran cond sub pod time code
1 1     1   425 use 5.20.0;
  1         10  
2 1     1   5 use warnings;
  1         2  
  1         67  
3             package Games::Nintendo::Mario::SMB3 0.209;
4             # ABSTRACT: a class for fuzzy-tailed Italian plumbers
5              
6 1     1   420 use parent qw(Games::Nintendo::Mario);
  1         409  
  1         5  
7              
8             #pod =head1 SYNOPSIS
9             #pod
10             #pod use Games::Nintendo::Mario::SMB3;
11             #pod
12             #pod my $hero = Games::Nintendo::Mario::SMB->new(
13             #pod name => 'Mario',
14             #pod state => 'hammer',
15             #pod );
16             #pod
17             #pod $hero->powerup('mushroom'); # Nothing happens.
18             #pod $hero->damage; # back to super
19             #pod
20             #pod print "It's-a me! ", $hero->name, "!\n"; # 'Super Mario'
21             #pod
22             #pod $hero->powerup('frogsuit'); # Nothing happens.
23             #pod
24             #pod $hero->damage for (1 .. 2); # cue the Mario Death Music
25             #pod
26             #pod =head1 DESCRIPTION
27             #pod
28             #pod This class subclasses Games::Nintendo::Mario, providing a model of the behavior
29             #pod of the Mario Brothers in Super Mario Brothers 3. All of the methods described
30             #pod in the Mario interface exist as documented.
31             #pod
32             #pod =head2 NAMES
33             #pod
34             #pod The plumber may be named Mario or Luigi.
35             #pod
36             #pod =head2 STATES
37             #pod
38             #pod The plumber's state may be any of: C, C, C, C,
39             #pod C, C, C, or C
40             #pod
41             #pod =head2 POWERUPS
42             #pod
43             #pod Valid powerups are: C, C, C, C,
44             #pod C, C, or C
45             #pod
46             #pod =method games
47             #pod
48             #pod This ruleset reflects Mario in Super Mario Bros. 3.
49             #pod
50             #pod =cut
51              
52 1     1   4 sub _names { qw[Mario Luigi] }
53 1     1   6 sub _states { qw[normal super fire raccoon tanooki frog hammer pwing] }
54 2     2   8 sub _items { qw[mushroom flower leaf tanookisuit frogsuit hammersuit pwing] }
55              
56             sub _goto_hash {
57             {
58 3     3   28 damage => {
59             normal => 'dead',
60             super => 'normal',
61             _else => 'super'
62             },
63             mushroom => {
64             normal => 'super'
65             },
66             flower => 'fire',
67             leaf => 'raccoon',
68             tanookisuit => 'tanooki',
69             hammersuit => 'hammer',
70             frogsuit => 'frog',
71             pwing => 'pwing'
72             }
73             }
74              
75             sub games {
76 0     0 1   return ('Super Mario Bros. 3');
77             }
78              
79             "It's-a me! Mario!";
80              
81             __END__