public List <string> LoadFromString(TitleTable allTitles, string titleIDs) { List <string> errorMsg = new List <string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = titleIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Title title = null; try { for (int i = 0; i < strArray.Length; i++) { if (allTitles.Titles.TryGetValue(int.Parse(strArray[i]), out title)) { this.AddTitle(title); } else { errorMsg.Add("称号ID" + int.Parse(strArray[i]) + "不存在"); } } } catch { errorMsg.Add("兵种一栏应为半型空格分隔的影响ID"); } return(errorMsg); }
public List<string> LoadFromString(TitleTable allTitles, string titleIDs) { List<string> errorMsg = new List<string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = titleIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Title title = null; try { for (int i = 0; i < strArray.Length; i++) { if (allTitles.Titles.TryGetValue(int.Parse(strArray[i]), out title)) { this.AddTitle(title); } else { errorMsg.Add("称号ID" + int.Parse(strArray[i]) + "不存在"); } } } catch { errorMsg.Add("兵种一栏应为半型空格分隔的影响ID"); } return errorMsg; }
public void LoadFromString(TitleTable allTitles, string titleIDs) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = titleIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Title title = null; for (int i = 0; i < strArray.Length; i++) { if (allTitles.Titles.TryGetValue(int.Parse(strArray[i]), out title)) { this.AddTitle(title); } } }
public void LoadFromString(TitleTable allTitles, string titleIDs) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = titleIDs.Split(separator, StringSplitOptions.RemoveEmptyEntries); Title title = null; for (int i = 0; i < strArray.Length; i++) { if (allTitles.Titles.TryGetValue(int.Parse(strArray[i]), out title)) { this.AddTitle(title); } } }
public bool IsInheritable(TitleTable allTitles) { if (inheritable.HasValue) { return(inheritable.Value); } foreach (Title t in allTitles.GetTitleList()) { if (t.Kind == this && t.CanBeBorn()) { inheritable = true; return(true); } } inheritable = false; return(false); }
public bool IsInheritable(TitleTable allTitles) { if (inheritable.HasValue) { return inheritable.Value; } foreach (Title t in allTitles.GetTitleList()) { if (t.Kind == this && t.CanBeBorn()) { inheritable = true; return true; } } inheritable = false; return false; }