Exemplo n.º 1
0
        public void Update(JSONNode data)
        {
            id                  = data.GetString(ID);
            name                = data.GetString(NAME);
            levelNum            = data.GetInt(LEVEL_NUM);
            maxMoves            = data.GetInt(MAX_MOVES, (int)LevelEditorInfo.Instance.DefaultValues[MAX_MOVES]);
            superMergingEnabled = data.GetBoolean(SUPER_MERGING_ENABLED, (bool)LevelEditorInfo.Instance.DefaultValues[SUPER_MERGING_ENABLED]);

            width  = data.GetInt(WIDTH, LevelEditorInfo.Instance.BoardWidth);
            height = data.GetInt(HEIGHT, LevelEditorInfo.Instance.BoardHeight);

            ParseStars(data.GetCollection(STARS));

            bossName = data.GetString(BOSS_NAME, (string)LevelEditorInfo.Instance.DefaultValues[BOSS_NAME]);
            string setName = data.GetString(SPAWNING_SET_NAME);

            spawningSetName = (string.IsNullOrEmpty(setName) || setName == "0")
                                ? spawningSetName
                                : setName;
            adaptiveColorSpawningOffset = data.GetInt(ADAPTIVE_COLOR_SPAWNING_OFFSET, 0);

            acsMin = data.GetInt(ACS_MIN, (int)LevelEditorInfo.Instance.DefaultValues[ACS_MIN]);
            acsMax = data.GetInt(ACS_MAX, (int)LevelEditorInfo.Instance.DefaultValues[ACS_MAX]);

            ParseLayers(data.GetDictionary(LAYERS));
            ParseConditions(data.GetDictionary(CONDITIONS));
            ParseCompanion(data.GetDictionary(COMPANION));
            ParseColorSpawnPercentages(data);
            ParseItemSpawnPercentages(data);
            ParsePreventCreation(data);
            ParseEnsureItems(data);
            ParseColorSpawningOrder(data);
        }