コード例 #1
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
 private void NotifyInnerWorldFirstCompleted(World innerWorld)
 {
     if (innerWorld != null)
     {
         WorldStorage.SetLastCompletedInnerWorld(this, innerWorld.ID);
     }
 }
コード例 #2
0
        /// <summary>
        /// Initializes the specified <c>InitialWorld</c> and rewards.
        /// </summary>
        /// <param name="initialWorld">Initial world.</param>
        public static void Initialize(World initialWorld)
        {
            InitialWorld = initialWorld;

            save();

            WorldStorage.InitLevelUp();
        }
コード例 #3
0
ファイル: World.cs プロジェクト: makezi/shape-clash
 public void SetCompleted(bool completed, bool recursive)
 {
     if (recursive)
     {
         foreach (World world in InnerWorldsMap.Values)
         {
             world.SetCompleted(completed, true);
         }
     }
     WorldStorage.SetCompleted(this, completed);
 }
コード例 #4
0
        void ClearCurrentState()
        {
            List <String> allKeys = KeyValueStorage.GetEncryptedKeys();

            if (allKeys != null)
            {
                foreach (string key in allKeys)
                {
                    if (key.StartsWith(GateStorage.getKeyGatePrefix()) ||
                        key.StartsWith(LevelStorage.getKeyLevelPrefix()) ||
                        key.StartsWith(MissionStorage.getKeyMissionPrefix()) ||
                        key.StartsWith(ScoreStorage.getKeyScorePrefix()) ||
                        key.StartsWith(WorldStorage.getKeyWorldPrefix()))
                    {
                        KeyValueStorage.DeleteKeyValue(key);
                    }
                }
            }
        }
コード例 #5
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
        public void SetCompleted(bool completed, bool recursive)
        {
            if (recursive)
            {
                foreach (World world in InnerWorldsMap.Values)
                {
                    world.SetCompleted(completed, true);
                }
            }

            // keep current completed state
            bool alreadyCompleted = IsCompleted();

            WorldStorage.SetCompleted(this, completed);

            if (!alreadyCompleted && completed && (ParentWorld != null))
            {
                ParentWorld.NotifyInnerWorldFirstCompleted(this);
            }
        }
コード例 #6
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
        /** Reward Association **/

        /// <summary>
        /// Assigns the given reward to this <c>World</c>.
        /// </summary>
        /// <param name="reward">Reward to assign.</param>
        public void AssignReward(Reward reward)
        {
            String olderReward = GetAssignedRewardId();

            if (!string.IsNullOrEmpty(olderReward))
            {
                Reward oldReward = SoomlaLevelUp.GetReward(olderReward);
                if (oldReward != null)
                {
                    oldReward.Take();
                }
            }

            // We have to make sure the assigned reward can be assigned unlimited times.
            // There's no real reason why it won't be.
            if (reward.Schedule.ActivationLimit > 0)
            {
                reward.Schedule.ActivationLimit = 0;
            }

            reward.Give();
            WorldStorage.SetReward(this, reward.ID);
        }
コード例 #7
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
 /// <summary>
 /// Gets the last completed inner world ID.
 /// </summary>
 /// <returns>The last completed inner world ID.</returns>
 public string GetLastCompletedInnerWorld()
 {
     return(WorldStorage.GetLastCompletedInnerWorld(this));
 }
コード例 #8
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
 /// <summary>
 /// Retrieves the assigned reward ID.
 /// </summary>
 /// <returns>The assigned reward ID.</returns>
 public String GetAssignedRewardId()
 {
     return(WorldStorage.GetAssignedReward(this));
 }
コード例 #9
0
ファイル: World.cs プロジェクト: gavinsoe/Unity.Frankenchase
        /** Completion **/

        /// <summary>
        /// Determines whether this <c>World</c> is completed.
        /// </summary>
        /// <returns><c>true</c> if this instance is completed; otherwise, <c>false</c>.</returns>
        public bool IsCompleted()
        {
            return(WorldStorage.IsCompleted(this));
        }