Added a method definition to the Player class.