com.planeth.gtroids.stats
Class GameStats

java.lang.Object
  extended bycom.planeth.gtroids.stats.GameStats

public class GameStats
extends java.lang.Object

Handles the game stats like player points, ships, bombs, current level, etc.

Author:
Andreas Grässer, gal@planet-h.com.
created Jul 4, 2005

Constructor Summary
GameStats()
          Constructor for GameStats.
 
Method Summary
 void addBomb()
          Adds a bomb to the players account
 void addExtraShip()
          Adds an extra ship to the players account
 void addPoints(int points2add)
          Add Points to the players account
 boolean checkoutBomb()
          Checks out a bomb from the players account.
 boolean checkoutShip()
          Checks out a ship from the players account.
 void countEnemyKilled()
          Counts the killed enemies of the player.
 void decreasePointsFactor()
          Decreases the pointsFactor
protected  void finalize()
           
 WordReader getHighScoreReader()
          Returns the highScoreReader.
 int getKillsLeftForNextBoss()
          Returns the number of enemy kills left for next boss
 int getLevel()
          Returns the current level
 int getPointsFactor()
          Returns the pointsFactor
 void increaseLevel()
          Increases the current level
 void increasePointsFactor()
          Increases the pointsFactor
 boolean isEnteringHighScore()
          Returns true, if the game is in entering highScore mode.
 boolean isGameRunning()
          Returns true, if a game is running.
 boolean isPaused()
          Returns true, if the game is paused
 void markCheatUsed()
          Mark the game as played with cheatcodes
Saving highscore will be disabled, if using cheats.
 void paint(java.awt.Graphics g, Vector2D panelBounds)
          Paints the stats into the passed Graphics
 void resetEnemiesKilled()
          Resets the number of enemies killed
 void saveHighScore()
          Saves a highscore to the remote list
 void setHighScoreList(java.util.List highScoreList)
          Sets the highScoreList
 void setPaused(boolean paused)
          If set to true, some actions for pausing the game will be done
 void startNewGame()
          Starts a new game
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GameStats

public GameStats()
Constructor for GameStats.

Method Detail

startNewGame

public void startNewGame()
Starts a new game


saveHighScore

public void saveHighScore()
Saves a highscore to the remote list


paint

public void paint(java.awt.Graphics g,
                  Vector2D panelBounds)
Paints the stats into the passed Graphics

Parameters:
g - Graphics to paint into
panelBounds - the bounds of the gamePanel

addPoints

public void addPoints(int points2add)
Add Points to the players account

Parameters:
points2add - the points to add

addExtraShip

public void addExtraShip()
Adds an extra ship to the players account


checkoutShip

public boolean checkoutShip()
Checks out a ship from the players account.
Returns true, if a ship is available.

Returns:
Returns true, if a ship is available.

isGameRunning

public boolean isGameRunning()
Returns true, if a game is running.

Returns:
Returns true, if a game is running.

isEnteringHighScore

public boolean isEnteringHighScore()
Returns true, if the game is in entering highScore mode.

Returns:
Returns true, if the game is in entering highScore mode.

isPaused

public boolean isPaused()
Returns true, if the game is paused

Returns:
Returns true, if the game is paused

setPaused

public void setPaused(boolean paused)
If set to true, some actions for pausing the game will be done

Parameters:
paused - true = pause, false = unpause

checkoutBomb

public boolean checkoutBomb()
Checks out a bomb from the players account.
Returns true, if a bomb is available

Returns:
Returns true, if a bomb is available

addBomb

public void addBomb()
Adds a bomb to the players account


setHighScoreList

public void setHighScoreList(java.util.List highScoreList)
Sets the highScoreList

Parameters:
highScoreList - The highScoreList to set.

getHighScoreReader

public WordReader getHighScoreReader()
Returns the highScoreReader.
A WordReader to read the players name.

Returns:
Returns the highScoreReader.

increasePointsFactor

public void increasePointsFactor()
Increases the pointsFactor


decreasePointsFactor

public void decreasePointsFactor()
Decreases the pointsFactor


getPointsFactor

public int getPointsFactor()
Returns the pointsFactor

Returns:
Returns the pointsFactor.

markCheatUsed

public void markCheatUsed()
Mark the game as played with cheatcodes
Saving highscore will be disabled, if using cheats.


getLevel

public int getLevel()
Returns the current level

Returns:
Returns the current level

increaseLevel

public void increaseLevel()
Increases the current level


countEnemyKilled

public void countEnemyKilled()
Counts the killed enemies of the player.
This should always be called, if the player kills an enemy.


resetEnemiesKilled

public void resetEnemiesKilled()
Resets the number of enemies killed


getKillsLeftForNextBoss

public int getKillsLeftForNextBoss()
Returns the number of enemy kills left for next boss

Returns:
Returns the number of enemy kills left for next boss

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable
See Also:
Object.finalize()