public List <string> LoadFromString(TechniqueTable allTechniques, string techniqueIDs) { List <string> errorMsg = new List <string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = techniqueIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Technique technique = null; try { for (int i = 0; i < strArray.Length; i++) { if (allTechniques.Techniques.TryGetValue(int.Parse(strArray[i]), out technique)) { this.AddTechnique(technique); } else { errorMsg.Add("技巧ID" + strArray[i] + "不存在"); } } } catch { errorMsg.Add("技巧列表应为半型空格分隔的技巧ID"); } return(errorMsg); }
public List<string> LoadFromString(TechniqueTable allTechniques, string techniqueIDs) { List<string> errorMsg = new List<string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = techniqueIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Technique technique = null; try { for (int i = 0; i < strArray.Length; i++) { if (allTechniques.Techniques.TryGetValue(int.Parse(strArray[i]), out technique)) { this.AddTechnique(technique); } else { errorMsg.Add("技巧ID" + strArray[i] + "不存在"); } } } catch { errorMsg.Add("技巧列表应为半型空格分隔的技巧ID"); } return errorMsg; }
public void LoadFromString(TechniqueTable allTechniques, string techniqueIDs) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = techniqueIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Technique technique = null; for (int i = 0; i < strArray.Length; i++) { if (allTechniques.Techniques.TryGetValue(int.Parse(strArray[i]), out technique)) { this.AddTechnique(technique); } } }
public void LoadFromString(TechniqueTable allTechniques, string techniqueIDs) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = techniqueIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Technique technique = null; for (int i = 0; i < strArray.Length; i++) { if (allTechniques.Techniques.TryGetValue(int.Parse(strArray[i]), out technique)) { this.AddTechnique(technique); } } }