Beispiel #1
0
        internal AndroidLeaderboard(IDictionary _leaderboardData)
        {
            Identifier = _leaderboardData.GetIfAvailable <string>(kIdentifier);

            string _userScope = _leaderboardData.GetIfAvailable <string>(kUserScope);

            UserScope = kUserScopeMap[_userScope];

            string _timeScope = _leaderboardData.GetIfAvailable <string>(kTimeScope);

            TimeScope = kTimeScopeMap[_timeScope];

            Title = _leaderboardData.GetIfAvailable <string>(kTitle);

            IList _scoresList = _leaderboardData.GetIfAvailable <List <object> >(kScores);

            Scores = AndroidScore.ConvertScoreList(_scoresList);

            IDictionary _localScore = _leaderboardData.GetIfAvailable <Dictionary <string, object> >(kLocalUserScore);

            LocalUserScore = AndroidScore.ConvertScore(_localScore);


            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetLeaderboardGID(Identifier);
        }
        public EditorLeaderboard(EGCLeaderboard _gcLeaderboardInfo)
        {
            // Set properties from info object
            Identifier     = _gcLeaderboardInfo.Identifier;
            Title          = _gcLeaderboardInfo.Title;
            Scores         = null;
            LocalUserScore = null;

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetLeaderboardGID(Identifier);
        }
Beispiel #3
0
        public EditorAchievement(EGCAchievement _gcAchievementInfo)
        {
            // Set properties from info object
            Identifier          = _gcAchievementInfo.Identifier;
            PercentageCompleted = _gcAchievementInfo.PercentageCompleted;
            Completed           = _gcAchievementInfo.Completed;
            LastReportedDate    = _gcAchievementInfo.LastReportedDate;

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetAchievementGID(Identifier);
        }
Beispiel #4
0
        public iOSAchievement(IDictionary _dataDict)
        {
            // Parse data dictionary values
            Identifier          = _dataDict.GetIfAvailable <string>(kIdentifierKey);
            Completed           = _dataDict.GetIfAvailable <bool>(kCompletedKey);
            LastReportedDate    = _dataDict.GetIfAvailable <string>(kLastReportedDateKey).ToZuluFormatDateTimeLocal();
            PercentageCompleted = _dataDict.GetIfAvailable <double>(kPercentCompleteKey);

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetAchievementGID(Identifier);
        }
Beispiel #5
0
        public static Leaderboard GetLeaderboard(string _identifier, bool _isGlobalID)
        {
            string      _globalID    = _isGlobalID ? _identifier : GameServicesFeatureUtils.GetLeaderboardGID(_identifier);
            Leaderboard _leaderboard = null;

            if (_globalID != null)
            {
                leaderboardCollection.TryGetValue(_globalID, out _leaderboard);
            }

            return(_leaderboard);
        }
Beispiel #6
0
        internal EditorScore(EGCScore _scoreInfo)
        {
            string _leaderboardID = _scoreInfo.LeaderboardID;

            // Set properties
            LeaderboardGlobalID = GameServicesUtils.GetLeaderboardGID(_leaderboardID);
            LeaderboardID       = _leaderboardID;
            User  = new EditorUser(_scoreInfo.User);
            Value = _scoreInfo.Value;
            Date  = _scoreInfo.Date;
            Rank  = _scoreInfo.Rank;
        }
        internal AndroidScore(IDictionary _scoreData)
        {
            LeaderboardID       = _scoreData.GetIfAvailable <string>(kIdentifier);
            LeaderboardGlobalID = GameServicesUtils.GetLeaderboardGID(LeaderboardID);

            User  = new AndroidUser(_scoreData.GetIfAvailable <Dictionary <string, object> >(kUser));
            Value = _scoreData.GetIfAvailable <long>(kValue);

            long _timeInMillis = _scoreData.GetIfAvailable <long>(kDate);

            Date = _timeInMillis.ToDateTimeFromJavaTime();

            Rank = _scoreData.GetIfAvailable <int>(kRank);
        }
        public iOSLeaderboard(IDictionary _dataDict) : base()
        {
            // Parse data dictionary values
            Identifier     = _dataDict.GetIfAvailable <string>(kIdentifierKey);
            Title          = _dataDict.GetIfAvailable <string>(kTitleKey);
            UserScope      = (eLeaderboardUserScope)_dataDict.GetIfAvailable <int>(kPlayerScopeKey);
            TimeScope      = (eLeaderboardTimeScope)_dataDict.GetIfAvailable <int>(kTimeScopeKey);
            Scores         = null;
            LocalUserScore = null;
            m_range        = new Range(0, 0);

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetLeaderboardGID(Identifier);
        }
        public iOSAchievementDescription(IDictionary _dataDict)
        {
            // Parse data dictionary values
            Identifier            = _dataDict.GetIfAvailable <string>(kIdentifierKey);
            Title                 = _dataDict.GetIfAvailable <string>(kTitleKey);
            UnachievedDescription = _dataDict.GetIfAvailable <string>(kUnachievedDescriptionKey);
            AchievedDescription   = _dataDict.GetIfAvailable <string>(kAchievedDescriptionKey);
#pragma warning disable
            MaximumPoints = _dataDict.GetIfAvailable <int>(kMaximumPointsKey);
#pragma warning restore
            IsHidden = _dataDict.GetIfAvailable <bool>(kHiddenKey);

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetAchievementGID(Identifier);
        }
Beispiel #10
0
        internal void SetDetails(IDictionary _achievementData)
        {
            Identifier = _achievementData.GetIfAvailable <string>(kIdentifier);
            Completed  = _achievementData.GetIfAvailable <bool>(kCompleted);
            int _stepsFinished = _achievementData.GetIfAvailable <int>(kCurrentSteps);
            int _maxSteps      = _achievementData.GetIfAvailable <int>(kMaxSteps);

            PercentageCompleted = ((double)_stepsFinished / _maxSteps) * 100d;

            long _timeInMillis = _achievementData.GetIfAvailable <long>(kLastReportDate);

            LastReportedDate = _timeInMillis.ToDateTimeFromJavaTime();

            GlobalIdentifier = GameServicesUtils.GetAchievementGID(Identifier);
        }
        public EditorAchievementDescription(EGCAchievementDescription _gcDescriptionInfo)
        {
            // Set properties from info object
            Identifier            = _gcDescriptionInfo.Identifier;
            Title                 = _gcDescriptionInfo.Title;
            UnachievedDescription = _gcDescriptionInfo.UnachievedDescription;
            AchievedDescription   = _gcDescriptionInfo.AchievedDescription;
#pragma warning disable
            MaximumPoints = _gcDescriptionInfo.MaximumPoints;
#pragma warning restore
            IsHidden = _gcDescriptionInfo.IsHidden;

            // Set global identifier
            GlobalIdentifier = GameServicesUtils.GetAchievementGID(Identifier);
        }
Beispiel #12
0
        public iOSScore(IDictionary _dataDict) : base()
        {
            // Parse data dictionary values
            string      _leaderboardID = _dataDict.GetIfAvailable <string>(kLeaderboardIdentifierKey);
            IDictionary _userDataDict  = _dataDict.GetIfAvailable <IDictionary>(kPlayerKey);

            LeaderboardGlobalID = GameServicesUtils.GetLeaderboardGID(_leaderboardID);
            LeaderboardID       = _leaderboardID;
            Value = _dataDict.GetIfAvailable <long>(kValueKey);
            Date  = _dataDict.GetIfAvailable <string>(kDateKey).ToZuluFormatDateTimeLocal();
            Rank  = _dataDict.GetIfAvailable <int>(kRankKey);

            if (_userDataDict != null)
            {
                User = new iOSUser(_userDataDict);
            }
        }