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.6.2';
3 2     2   13 use warnings;
  2         4  
  2         63  
4 2     2   10 use strict;
  2         4  
  2         41  
5              
6 2     2   8 use parent 'Games::ABC_Path::Solver::Base';
  2         4  
  2         9  
7              
8              
9 2     2   101 use integer;
  2         5  
  2         8  
10              
11              
12             sub x
13             {
14 28465     28465 1 40065 my $self = shift;
15              
16 28465 100       49874 if (@_)
17             {
18 8761         14341 $self->{x} = shift;
19             }
20              
21 28465         59157 return $self->{x};
22             }
23              
24              
25             sub y
26             {
27 27465     27465 1 39545 my $self = shift;
28              
29 27465 100       49443 if (@_)
30             {
31 8761         13268 $self->{'y'} = shift;
32             }
33              
34 27465         51769 return $self->{'y'};
35             }
36              
37             sub _to_s
38             {
39 660     660   1002 my $self = shift;
40              
41 660         1084 return sprintf( "%d,%d", $self->x, $self->y );
42             }
43              
44             sub _init
45             {
46 8761     8761   14244 my ( $self, $args ) = @_;
47              
48 8761         19416 $self->x( $args->{x} );
49 8761         18423 $self->y( $args->{'y'} );
50              
51 8761         15846 return;
52             }
53              
54             sub _equal
55             {
56 625     625   942 my ( $self, $other_xy ) = @_;
57              
58 625   100     1007 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__