vooga.users.user
Class UserGameStats

java.lang.Object
  extended by vooga.users.user.UserGameStats
All Implemented Interfaces:
java.io.Serializable

public class UserGameStats
extends java.lang.Object
implements java.io.Serializable

Contains user-specific information about a given game.

Version:
1.0
Author:
Stephanie Chang, Alex Edelsburg
See Also:
Serialized Form

Constructor Summary
UserGameStats(java.lang.String gameName)
          Constructor.
 
Method Summary
protected  void addAchievement(java.lang.String achievement)
          Adds this achievement
protected  boolean checkAndSetHighScore(int score)
          Checks whether the given score is a high score.
protected  void favoriteGame()
          Set this game as a favorite game.
protected  java.util.List<java.lang.String> getAchievements()
           
protected  java.lang.String getMyGame()
          Returns the name of the game associated with this UserGameStats object.
protected  int getMyHighScore()
          Returns the user's high score for this AbstractGame.
protected  java.util.Date getMyLastPlayTime()
          Returns the user's last game play time associated with this AbstractGame.
protected  boolean isFavorite()
          Returns true if the game is a favorite, or false if it is not.
protected  void unFavoriteGame()
          "Un-favorite" this game.
protected  void updateLastPlayTime(java.util.Date playTime)
          Updates the most recent game play time with the given Date object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserGameStats

public UserGameStats(java.lang.String gameName)
Constructor. Every UserGameStats object must be associated with an AbstractGame. Initializes all internal data structures.

Parameters:
game - the game associated with this UserGameStats object
Method Detail

checkAndSetHighScore

protected boolean checkAndSetHighScore(int score)
Checks whether the given score is a high score.

Parameters:
score - the game score
Returns:
true if score exceeds current high score

updateLastPlayTime

protected void updateLastPlayTime(java.util.Date playTime)
Updates the most recent game play time with the given Date object

Parameters:
playTime - the Date object with the most recent play time

favoriteGame

protected void favoriteGame()
Set this game as a favorite game.


unFavoriteGame

protected void unFavoriteGame()
"Un-favorite" this game.


getMyGame

protected java.lang.String getMyGame()
Returns the name of the game associated with this UserGameStats object.

Returns:
the name of the game

getMyLastPlayTime

protected java.util.Date getMyLastPlayTime()
Returns the user's last game play time associated with this AbstractGame.

Returns:
the last game play time

addAchievement

protected void addAchievement(java.lang.String achievement)
Adds this achievement

Parameters:
achievement - the achievement to add

getAchievements

protected java.util.List<java.lang.String> getAchievements()
Returns:
the achievements for this UserGameStats

getMyHighScore

protected int getMyHighScore()
Returns the user's high score for this AbstractGame.

Returns:
the high score for this game

isFavorite

protected boolean isFavorite()
Returns true if the game is a favorite, or false if it is not.

Returns:
true if the game is a favorite