Class PlayerProfile

java.lang.Object
  extended by PlayerProfile
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PlayerProfile
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Class used to store player game data. This data consists of a User Name, a Password, wins/ties/losses record. This class can and should be extended so that a user can add specific details to the profile for certain games (chess/checkers/othello/etc.) This class does not take care of logging in or out, that is done by the server. This simply stores profile information.

See Also:
Serialized Form

Constructor Summary
PlayerProfile(java.lang.String initName, java.lang.String initPass)
          Constructor to initialize the name and the password of a player.
 
Method Summary
 void changePass(java.lang.String newPass)
          Change the password of the current player.
 PlayerProfile clone()
           
 int getLosses()
           
 java.lang.String getName()
           
 java.lang.String getPass()
           
 int getTies()
           
 int getWins()
           
 void lost()
          Increment the losses of the player
 void tied()
          Increment the ties of the player
 void won()
          Increment the wins of the player
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerProfile

public PlayerProfile(java.lang.String initName,
                     java.lang.String initPass)
Constructor to initialize the name and the password of a player.

Method Detail

clone

public PlayerProfile clone()
Overrides:
clone in class java.lang.Object

won

public void won()
Increment the wins of the player


lost

public void lost()
Increment the losses of the player


tied

public void tied()
Increment the ties of the player


getWins

public int getWins()

getLosses

public int getLosses()

getTies

public int getTies()

getName

public java.lang.String getName()
Returns:
- The name of the player

getPass

public java.lang.String getPass()
Returns:
- The password of the player

changePass

public void changePass(java.lang.String newPass)
Change the password of the current player.