Subject: | get_color() method doesn't seem to be implemented |
The get_color() method doesn't seem to be implemented:
Can't locate object method "get_color" via package "Chess::Piece::Rook"
I've added the code at the bottom to the Chess::Piece and everything
works fine now.
sub get_color {
my ($self) = @_;
croak "Invalid Chess::Piece reference" unless (ref($self));
my $r_piece = _get_piece_ref($$self);
croak "Invalid Chess::Piece reference" unless ($r_piece);
return $r_piece->{player};
}