File Coverage

blib/lib/Games/ABC_Path/Solver/Coord.pm
Criterion Covered Total %
statement 28 28 100.0
branch 4 4 100.0
condition 3 3 100.0
subroutine 9 9 100.0
pod 2 2 100.0
total 46 46 100.0


line stmt bran cond sub pod time code
1             package Games::ABC_Path::Solver::Coord;
2             $Games::ABC_Path::Solver::Coord::VERSION = '0.8.1';
3 8     8   337134 use warnings;
  8         32  
  8         503  
4 8     8   42 use strict;
  8         15  
  8         196  
5              
6 8     8   33 use parent 'Games::ABC_Path::Solver::Base';
  8         38  
  8         49  
7              
8              
9 8     8   629 use integer;
  8         14  
  8         49  
10              
11              
12             sub x
13             {
14 108459     108459 1 151470 my $self = shift;
15              
16 108459 100       195761 if (@_)
17             {
18 33781         58115 $self->{x} = shift;
19             }
20              
21 108459         238965 return $self->{x};
22             }
23              
24              
25             sub y
26             {
27 105339     105339 1 148918 my $self = shift;
28              
29 105339 100       185261 if (@_)
30             {
31 33781         53072 $self->{'y'} = shift;
32             }
33              
34 105339         204650 return $self->{'y'};
35             }
36              
37             sub _to_s
38             {
39 1980     1980   3262 my $self = shift;
40              
41 1980         4010 return sprintf( "%d,%d", $self->x, $self->y );
42             }
43              
44             sub _init
45             {
46 33781     33781   55564 my ( $self, $args ) = @_;
47              
48 33781         77904 $self->x( $args->{x} );
49 33781         74952 $self->y( $args->{'y'} );
50              
51 33781         60579 return;
52             }
53              
54             sub _equal
55             {
56 1950     1950   2810 my ( $self, $other_xy ) = @_;
57              
58 1950   100     2956 return ( ( $self->x == $other_xy->x ) && ( $self->y == $other_xy->y ) );
59             }
60              
61              
62             1; # End of Games::ABC_Path::Solver::Base
63              
64             __END__