public static List<TriggeredAbility> createList(JSONArray listTemplate) { List<TriggeredAbility> result = new List<TriggeredAbility>(); if (listTemplate != null) { foreach (JSONArray template in listTemplate.asJSONArrays()) { result.Add(new TriggeredAbility(template)); } } return result; }
public LevelScreen(JSONArray chaptersTemplate) { chapters = new List<List<LevelState>>(); foreach (JSONArray levelListTemplate in chaptersTemplate.asJSONArrays()) { List<LevelState> levels = new List<LevelState>(); chapters.Add(levels); foreach (JSONTable levelTemplate in levelListTemplate.asJSONTables()) { levels.Add(new LevelState(levelTemplate)); } } chapters[0][0].unlocked = true; }