GetSocial Cordova SDK

SCORE_TYPE

declaration
 SCORE_TYPE 

Copyright 2015-2016 GetSocial B.V.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

var SCORE_TYPE = {
      WORLD: 1,
      FOLLOWING: 2,
      OTHERS: 3
    }

var LeaderboardScore = function(serializedObject) {
    this.user = null;
    this.value = -1;
    this.rank = -1;
    this.deserialize(serializedObject);
}

LeaderboardScore.prototype.deserialize = function(object) {
    if(object == null)
        return null;
           
    if(object.user != undefined) {
        this.user =  new User(JSON.parse(object.user));
    }
    this.value = object.value;
    this.rank = object.rank;
}

LeaderboardScore.prototype.getUser = function() {
    return this.user;
}

LeaderboardScore.prototype.getValue = function() {
    return this.value;
}

LeaderboardScore.prototype.getRank = function() {
    return this.rank;
}


LeaderboardScore.SCORE_TYPE = SCORE_TYPE;
module.exports = LeaderboardScore;