static int MatchEnhancement(string iEnh) { int enhancementByName; if (iEnh.IndexOf("-I") > -1) { int startIndex = 0; int num = iEnh.IndexOf("-"); enhancementByName = DatabaseAPI.GetEnhancementByName(iEnh.Substring(startIndex, num), Enums.eType.InventO); } else if (iEnh.IndexOf("-") > -1 & iEnh.IndexOf("-S") < 0) { string iSet = iEnh.Substring(0, iEnh.IndexOf("-")); int num = iEnh.IndexOf(":"); string iName; if (num < 0) { iName = iEnh.Substring(iEnh.IndexOf("-") + 1); } else { iName = iEnh.Substring(iEnh.IndexOf("-") + 1, num - (iEnh.IndexOf("-") + 1)); } enhancementByName = DatabaseAPI.GetEnhancementByName(iName, iSet); } else { enhancementByName = DatabaseAPI.GetEnhancementByName(iEnh); } return(enhancementByName); }
static int MatchEnhancement(string iEnh) { if (iEnh.IndexOf("-I") > -1) { int startIndex = 0; int length = iEnh.IndexOf("-"); return(DatabaseAPI.GetEnhancementByName(iEnh.Substring(startIndex, length), Enums.eType.InventO)); } if (iEnh.IndexOf("-") > -1 & iEnh.IndexOf("-S") < 0) { string iSet = iEnh.Substring(0, iEnh.IndexOf("-")); int num = iEnh.IndexOf(":"); return(DatabaseAPI.GetEnhancementByName(num >= 0 ? iEnh.Substring(iEnh.IndexOf("-") + 1, num - (iEnh.IndexOf("-") + 1)) : iEnh.Substring(iEnh.IndexOf("-") + 1), iSet)); } return(DatabaseAPI.GetEnhancementByName(iEnh)); }
static int MatchEnhancement(string iEnh) { if (iEnh.IndexOf("-I", StringComparison.Ordinal) > -1) { int startIndex = 0; int length = iEnh.IndexOf("-", StringComparison.Ordinal); return(DatabaseAPI.GetEnhancementByName(iEnh.Substring(startIndex, length), Enums.eType.InventO)); } if (!(iEnh.IndexOf("-", StringComparison.Ordinal) > -1 & iEnh.IndexOf("-S", StringComparison.Ordinal) < 0)) { return(DatabaseAPI.GetEnhancementByName(iEnh)); } string iSet = iEnh.Substring(0, iEnh.IndexOf("-", StringComparison.Ordinal)); int num = iEnh.IndexOf(":", StringComparison.Ordinal); return(DatabaseAPI.GetEnhancementByName( num >= 0 ? iEnh.Substring(iEnh.IndexOf("-", StringComparison.Ordinal) + 1, num - (iEnh.IndexOf("-", StringComparison.Ordinal) + 1)) : iEnh.Substring(iEnh.IndexOf("-", StringComparison.Ordinal) + 1), iSet)); }