home *** CD-ROM | disk | FTP | other *** search
- function User_Stats_Base()
- {
- if( !(this instanceof User_Stats_Base)) return new User_Stats_Base( );
- var protect = this.createProtection(JAX_Object);
- protect.gamesPlayed = "";
- protect.wins = "";
- protect.losses = "";
- protect.disconnects = "";
- protect.rating = "";
- protect.winPercentage = "";
- };
- User_Stats_Base.prototype = new JAX_Object;
- User_Stats_Base.prototype.getGamesPlayed = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.gamesPlayed;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.getWins = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.wins;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.getLosses = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.losses;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.getDisconnects = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.disconnects;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.getRating = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.rating;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.getWinPercentage = function()
- {
- try {
- var protect = this.getProtection(User_Stats_Base);
- return protect.winPercentage;
- } catch (e) {
- return -1;
- };
- };
- User_Stats_Base.prototype.setGamesPlayed = function(gameCount)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(gameCount))) ) {
- protect.gamesPlayed = gameCount;
- } else {
- protect.gamesPlayed = 0;
- };
- };
- User_Stats_Base.prototype.setWins = function(winCount)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(winCount))) ) {
- protect.wins = winCount;
- } else {
- protect.wins = 0;
- };
- };
- User_Stats_Base.prototype.setLosses = function(lossCount)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(lossCount))) ) {
- protect.losses = lossCount;
- } else {
- protect.losses = lossCount;
- };
- };
- User_Stats_Base.prototype.setDisconnects = function(disConnCount)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(disConnCount))) ) {
- protect.disconnects = disConnCount;
- } else {
- protect.disconnects = 0;
- };
- };
- User_Stats_Base.prototype.setRating = function(rating)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(rating))) ) {
- protect.rating = rating;
- } else {
- protect.rating = 0;
- };
- };
- User_Stats_Base.prototype.setWinPercentage = function(winPercnt)
- {
- var protect = this.getProtection(User_Stats_Base);
- if ( !(isNaN(parseInt(winPercnt))) ) {
- protect.winPercentage = winPercnt;
- } else {
- protect.winPercentage = 0;
- };
- };