public ResultSet Parse() { var resultSetBuilder = new ResultSetBuilder(); _mapList.Clear(); for (var i = 0; i < _selection.Length; i++) { var file = _selection[i]; RaiseStepEvent(file, i); try { var content = File.ReadAllText(file); var document = ParsedDocument.From(file, content); if (document.RootNode.SectionType != "Map") { continue; } _mapList.Add(document); } catch (ParserException ex) { resultSetBuilder.AddProblem(ProblemSeverity.Fatal, file, ex.Message); } } return(resultSetBuilder.ToResultSet()); }
public ResultSet ValidateDependencies() { var resultSetBuilder = new ResultSetBuilder(); for (var i = 0; i < _materialInstanceList.Count; i++) { var document = _materialInstanceList[i]; RaiseStepEvent(document.FileName, i); var material = FindUnrealMaterialByInstanceDocument(document); if (material == null) { resultSetBuilder.AddProblem(ProblemSeverity.Fatal, document.FileName, "Parent material not found"); } } return(resultSetBuilder.ToResultSet()); }
public ResultSet Parse() { var resultSetBuilder = new ResultSetBuilder(); _materialList.Clear(); _materialInstanceList.Clear(); for (var i = 0; i < _selection.Length; i++) { var file = _selection[i]; RaiseStepEvent(file, i); try { var content = File.ReadAllText(file); var document = ParsedDocument.From(file, content); var classValue = document.RootNode.FindAttributeValue("Class"); if (document.RootNode.SectionType != "Object") { continue; } if (classValue == "/Script/Engine.Material") { _materialList.Add(document); } else if (classValue == "/Script/Engine.MaterialInstanceConstant") { _materialInstanceList.Add(document); } } catch (ParserException ex) { resultSetBuilder.AddProblem(ProblemSeverity.Fatal, file, ex.Message); } } return(resultSetBuilder.ToResultSet()); }