public void ResetCriteriaTree(uint criteriaTreeId) { CriteriaTree tree = Global.CriteriaMgr.GetCriteriaTree(criteriaTreeId); if (tree == null) { return; } CriteriaManager.WalkCriteriaTree(tree, criteriaTree => { RemoveCriteriaProgress(criteriaTree.Criteria); }); }
public void LoadDB2Data() { _scenarioData.Clear(); Dictionary <uint, Dictionary <byte, ScenarioStepRecord> > scenarioSteps = new Dictionary <uint, Dictionary <byte, ScenarioStepRecord> >(); uint deepestCriteriaTreeSize = 0; foreach (ScenarioStepRecord step in CliDB.ScenarioStepStorage.Values) { if (!scenarioSteps.ContainsKey(step.ScenarioID)) { scenarioSteps[step.ScenarioID] = new Dictionary <byte, ScenarioStepRecord>(); } scenarioSteps[step.ScenarioID][step.OrderIndex] = step; CriteriaTree tree = Global.CriteriaMgr.GetCriteriaTree(step.CriteriaTreeId); if (tree != null) { uint criteriaTreeSize = 0; CriteriaManager.WalkCriteriaTree(tree, treeFunc => { ++criteriaTreeSize; }); deepestCriteriaTreeSize = Math.Max(deepestCriteriaTreeSize, criteriaTreeSize); } } //ASSERT(deepestCriteriaTreeSize < MAX_ALLOWED_SCENARIO_POI_QUERY_SIZE, "MAX_ALLOWED_SCENARIO_POI_QUERY_SIZE must be at least {0}", deepestCriteriaTreeSize + 1); foreach (ScenarioRecord scenario in CliDB.ScenarioStorage.Values) { ScenarioData data = new ScenarioData(); data.Entry = scenario; data.Steps = scenarioSteps.LookupByKey(scenario.Id); _scenarioData[scenario.Id] = data; } }