Esempio n. 1
0
        public bool Merge(IPlayerDataModel data)
        {
            Wallet other = (Wallet)data;

            if (other != null)
            {
                for (int i = 0; i < other._transactions.Count; i++)
                {
                    WalletTransaction otherTransaction            = other._transactions[i];
                    WalletTransaction sameTransactionInThisWallet = GetTransactionWithUUID(otherTransaction.UUID);
                    if (sameTransactionInThisWallet == null)
                    {
                        _transactions.Add(otherTransaction);
                    }
                    else
                    {
                        sameTransactionInThisWallet.Merge(otherTransaction);
                    }
                }

                _cached = false;
                SendBalanceUpdatedEvet();

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public bool Merge(IPlayerDataModel data)
        {
            AchievementsTracker other = (AchievementsTracker)data;

            if (other != null)
            {
                foreach (int achivementID in other._unlockedAchievements)
                {
                    if (!_unlockedAchievements.Contains(achivementID))
                    {
                        _unlockedAchievements.Add(achivementID);
                    }
                }

                foreach (KeyValuePair <int, int> param in other._parametersInt)
                {
                    if (_parametersInt.ContainsKey(param.Key))
                    {
                        if (_parametersInt[param.Key] < param.Value)
                        {
                            _parametersInt[param.Key] = param.Value;
                        }
                    }
                    else
                    {
                        _parametersInt.Add(param.Key, param.Value);
                    }
                }

                foreach (KeyValuePair <int, float> param in other._parametersFloat)
                {
                    if (_parametersFloat.ContainsKey(param.Key))
                    {
                        if (_parametersFloat[param.Key] < param.Value)
                        {
                            _parametersFloat[param.Key] = param.Value;
                        }
                    }
                    else
                    {
                        _parametersFloat.Add(param.Key, param.Value);
                    }
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        public bool Merge(IPlayerDataModel data)
        {
            APIState other = (APIState)data;

            if (other != null)
            {
                _adsEnabled = other.AdsEnabled;
                return(true);
            }
            else
            {
                return(true);
            }
        }
Esempio n. 4
0
        public bool Merge(IPlayerDataModel data)
        {
            AudioState other = (AudioState)data;

            if (other != null)
            {
                _soundEnabled = other._soundEnabled;
                _musicEnabled = other._musicEnabled;
                SendStateUpdateEvent();
                return(true);
            }
            else
            {
                return(true);
            }
        }
        public bool Merge(IPlayerDataModel data)
        {
            RateMePopupModel other = (RateMePopupModel)data;

            if (other != null)
            {
                if (other._eventsCounter > _eventsCounter)
                {
                    _eventsCounter = other._eventsCounter;
                }

                if (other._displayCounter > _displayCounter)
                {
                    _displayCounter = other._displayCounter;
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }