Fix polymorphism issue by refactoring the argument of the addPiece() method to take a pointer to a Piece instead of a Piece object