Esempio n. 1
0
    protected void settingMapLevelStatus(MapLevel level)
    {
        DataManagerKubera DataManager = (DataManagerKubera.GetInstance() as DataManagerKubera);

        if (level.isBoss)
        {
            /*//facebook
             * level.status = MapLevel.EMapLevelsStatus.BOSS_REACHED;
             * return;*/

            if (DataManager.isLevelPassed(level.lvlName))
            {
                level.status = MapLevel.EMapLevelsStatus.BOSS_PASSED;
            }
            else
            {
                if (DataManager.isLevelReached(level.lvlName))
                {
                    if (!DataManager.isLevelLocked(level.lvlName))
                    {
                        level.status = MapLevel.EMapLevelsStatus.BOSS_UNLOCKED;
                    }
                    else
                    {
                        level.status = MapLevel.EMapLevelsStatus.BOSS_REACHED;
                    }
                }
                else
                {
                    if (AllLevelsUnlocked)
                    {
                        level.status = MapLevel.EMapLevelsStatus.BOSS_REACHED;
                    }
                    else
                    {
                        level.status = MapLevel.EMapLevelsStatus.BOSS_LOCKED;
                    }
                }
            }
        }
        else
        {
            if (DataManager.isLevelPassed(level.lvlName))
            {
                level.status = MapLevel.EMapLevelsStatus.NORMAL_PASSED;
            }
            else
            {
                if (DataManager.isLevelReached(level.lvlName))
                {
                    level.status = MapLevel.EMapLevelsStatus.NORMAL_REACHED;
                }
                else
                {
                    if (AllLevelsUnlocked)
                    {
                        level.status = MapLevel.EMapLevelsStatus.NORMAL_REACHED;
                    }
                    else
                    {
                        level.status = MapLevel.EMapLevelsStatus.NORMAL_LOCKED;
                    }
                }
            }
        }

        switch (DataManager.getLevelStars(level.lvlName))
        {
        case 1:
            level.stars = MapLevel.EMapLevelStars.ONE;
            break;

        case 2:
            level.stars = MapLevel.EMapLevelStars.TWO;
            break;

        case 3:
            level.stars = MapLevel.EMapLevelStars.THREE;
            break;

        default:
            level.stars = MapLevel.EMapLevelStars.NONE;
            break;
        }
    }