Starmap/Star/Primary.pm

filter: Statementstmt 41.6% 20 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 46.4% 26 / 56 CC 1 SCAR 1.3
CC
1
Cov
42%
generate
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Starmap/Parsec.pm ↑ Summary Starmap.pm »
1 package RPG::Traveller::Starmap::Star::Primary;
2 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use RPG::Traveller::Starmap::Star;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶use RPG::Traveller::Starmap::Constants qw/ :starsizes :startypes /;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 5 ▶use RPG::Dice;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use feature 'switch';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 5 extends 'RPG::Traveller::Starmap::Star';
10  
11 # ABSTRACT: Encapsulates the behavior of a primary star
12  
13 0 ▶sub generate {
Subroutine generate: not called CC=1 SCAR=6.9
Pod undocumented
14 0 my $self = shift;
15 0 my $d1 = RPG::Dice->new('1d6');
16 0 my $d2 = RPG::Dice->new('2d6');
17  
18 0 given ( $d2->roll() ) {
19 0 when (2) {
20 0 $self->type(A);
21 }
22 0 when ( [ 3 .. 7 ] ) {
23 0 $self->type(M);
24 }
25 0 when (8) {
26 0 $self->type(K);
27 }
28 0 when (9) {
29 0 $self->type(G);
30 }
31 0 when ( [ 10 .. 12 ] ) {
32 0 $self->type(F);
33 }
34 }
35  
36 0 given ( $d2->roll() ) {
37 0 when (2) {
38 0 $self->size(II);
39 }
40 0 when (3) {
41 0 $self->size(III);
42 }
43 0 when (4) {
44 0 $self->size(IV);
45 }
46 0 when ( [ 5 .. 10 ] ) {
47 0 $self->size(V);
48 }
49 0 when (11) {
50 0 $self->size(VI);
51 }
52 0 when (12) {
53 0 $self->size(D);
54 }
55 }
56  
57 0 $self->getSpectralClass();
58  
59 }
60  
61 5 1;
62  
63 __END__
« Starmap/Parsec.pm ↑ Summary Starmap.pm »