net.curre.prefcount.bean
Class PlayerStatistics

java.lang.Object
  extended by net.curre.prefcount.bean.PlayerStatistics

public class PlayerStatistics
extends java.lang.Object

Object of this class represents various game scores/data for a player.

Created date: Apr 6, 2007

Author:
Yevgeny Nyden

Constructor Summary
PlayerStatistics(GameResultBean resultBean, int playerIndex)
          Constructor with a result bean argument.
 
Method Summary
 java.lang.Integer getBullet()
          Getter for the player's bullet value.
 java.lang.Integer getFinalMountainInVists()
          Returns the "final" computed mountain value in vists (x10), which is = (averageMountain - (mountain - minMountain)) x 10.
 java.lang.Integer getFinalScoreInVists()
          Returns computed final score (balance) in vists.
 java.lang.Integer getMountain()
          Getter for the player's mountain.
 java.lang.Integer getNewMountain()
          Returns the new computed mountain value according to the current targetBullet value.
 java.lang.String getPlayerName()
          Getter for the player's name.
 java.lang.String getPlayerNameLetter()
          Getter for the first letter of the player's name (returned capitalized).
 java.util.Map<java.lang.Integer,java.lang.Integer> getVistSaldoMap()
          Gets the map that holds vist saldo/balances that this player has against other players; the keys in this map are the other players indexes and the values are the corresponding vist saldo values;

total player's vist saldo/balance is stored under the same (as the player's index) key.

 java.lang.Integer getVistsForPlayer(java.lang.Integer playerInd)
          Returns vists for the given player (refered by its index).
 java.lang.String getVistsStringForPlayer(java.lang.Integer playerInd)
          Returns vists for the given player (refered by its index); value is returned as a string terminated with a period.
 void setBullet(java.lang.Integer bullet)
          Setter for the player's bullet value.
 void setBulletFromField(javax.swing.JTextField field)
          Setter for the player's bullet that is fetched from the passed JTextField argument.
 void setMountain(java.lang.Integer mountain)
          Setter for the player's mountain.
 void setMountainFromField(javax.swing.JTextField field)
          Setter for the player's mounatain that is fetched from the passed JTextField argument.
 void setPlayerName(java.lang.String playerName)
          Setter for the player's name.
 java.lang.Integer setVistsForPlayerFromField(java.lang.Integer playerInd, javax.swing.JTextField field)
          Setter for the player's vists that this player has against the player refered by its index argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayerStatistics

public PlayerStatistics(GameResultBean resultBean,
                        int playerIndex)
Constructor with a result bean argument.

Parameters:
resultBean - Reference to the result bean.
playerIndex - Player index.
Method Detail

getPlayerName

public java.lang.String getPlayerName()
Getter for the player's name.

Returns:
Player's name.

getPlayerNameLetter

public java.lang.String getPlayerNameLetter()
Getter for the first letter of the player's name (returned capitalized).

Returns:
Capitalized first letter of the player's name or an empty string if player's name is blank.

setPlayerName

public void setPlayerName(java.lang.String playerName)
Setter for the player's name.

Parameters:
playerName - Player's name to set.

getMountain

public java.lang.Integer getMountain()
Getter for the player's mountain.

Returns:
Player's mountain value.

setMountain

public void setMountain(java.lang.Integer mountain)
Setter for the player's mountain.

Parameters:
mountain - Player's new mountain value.

getNewMountain

public java.lang.Integer getNewMountain()
Returns the new computed mountain value according to the current targetBullet value.

Returns:
New computed mountain value.

getFinalMountainInVists

public java.lang.Integer getFinalMountainInVists()
Returns the "final" computed mountain value in vists (x10), which is = (averageMountain - (mountain - minMountain)) x 10.

Returns:
Final computed mountain value in vists (x10).

setMountainFromField

public void setMountainFromField(javax.swing.JTextField field)
Setter for the player's mounatain that is fetched from the passed JTextField argument.

Parameters:
field - JTextField to use to fetch the mountain value.

getBullet

public java.lang.Integer getBullet()
Getter for the player's bullet value.

Returns:
Player's bullet value.

setBullet

public void setBullet(java.lang.Integer bullet)
Setter for the player's bullet value.

Parameters:
bullet - Player's new bullet value.

setBulletFromField

public void setBulletFromField(javax.swing.JTextField field)
Setter for the player's bullet that is fetched from the passed JTextField argument.

Parameters:
field - JTextField to use to fetch the bullet value.

setVistsForPlayerFromField

public java.lang.Integer setVistsForPlayerFromField(java.lang.Integer playerInd,
                                                    javax.swing.JTextField field)
Setter for the player's vists that this player has against the player refered by its index argument.

Parameters:
playerInd - Other player's index that this player has vists against.
field - JTextField to use to fetch the vists value.
Returns:
Fetched vists value as an Integer object.

getVistsForPlayer

public java.lang.Integer getVistsForPlayer(java.lang.Integer playerInd)
Returns vists for the given player (refered by its index).

Parameters:
playerInd - Player index to fetch the vists for.
Returns:
Vists value that this player has agains the other player.

getVistsStringForPlayer

public java.lang.String getVistsStringForPlayer(java.lang.Integer playerInd)
Returns vists for the given player (refered by its index); value is returned as a string terminated with a period.

Parameters:
playerInd - Player index to fetch the vists for.
Returns:
Vists value that this player has agains the other player.

getFinalScoreInVists

public java.lang.Integer getFinalScoreInVists()
Returns computed final score (balance) in vists.

Returns:
Computed final score (balance) in vists.

getVistSaldoMap

public java.util.Map<java.lang.Integer,java.lang.Integer> getVistSaldoMap()
Gets the map that holds vist saldo/balances that this player has against other players; the keys in this map are the other players indexes and the values are the corresponding vist saldo values;

total player's vist saldo/balance is stored under the same (as the player's index) key.

Returns:
Map of vist saldo values that the player has against other playes.


Copyright © 2008. All Rights Reserved.