3DWorld/3DS/Chunk.pm untested

filter: Statementstmt 0.0% 0 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 8 totaltotal 0.0% 0 / 40 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
start
2.0
type
2.0
CRAP 2.0
1 package SDL::Tutorial::3DWorld::3DS::Chunk;
2  
3 use 5.008;
4 use strict;
5 use warnings;
6  
7 our $VERSION = '0.33';
8  
9  
10  
11  
12  
13 ######################################################################
14 # Constructor and Accessors
15  
16 sub new {
17 my $class = shift;
18 bless { children => [ ], @_ }, $class;
19 }
20  
21 sub start {
22 $_[0]->{start};
23 }
24  
25 sub type {
26 $_[0]->{type};
27 }
28  
29 sub bytes {
30 $_[0]->{bytes};
31 }
32  
33 sub children {
34 @{ $_[0]->{children} };
35 }
36  
37  
38  
39  
40  
41 ######################################################################
42 # Parsing Methods
43  
44 sub add {
45 push @{ shift->{children} }, @_;
46 }
47  
48 sub next_start {
49 $_[0]->{start} + $_[0]->{bytes};
50 }
51  
52 sub child_start {
53 $_[0]->{start} + 6;
54 }
55  
56 1;