public bool TryGetDefinition(string key, out AlternateStageEntry value) { // remove "STG" at start if (key.StartsWith("stg", StringComparison.InvariantCultureIgnoreCase)) { key = key.Substring(3); } // remove extension int index = key.IndexOf('.'); if (index >= 0) { key = key.Substring(0, index); } if (key.Length > 4) { key = key.Substring(0, 4); } key = key.ToUpperInvariant(); // Special handling is needed for short stage names. if (key == "ICE") { key = "ICE\x0e"; // Thank you Project M } // Not sure about GW yet return(AlternatesByStage.TryGetValue(key, out value)); }
public bool TryGetDefinition(string key, out AlternateStageEntry value) { // remove "STG" at start if (key.StartsWith("stg", StringComparison.InvariantCultureIgnoreCase)) key = key.Substring(3); // remove extension int index = key.IndexOf('.'); if (index >= 0) key = key.Substring(0, index); if (key.Length > 4) key = key.Substring(0, 4); key = key.ToUpperInvariant(); // Special handling is needed for short stage names. if (key == "ICE") key = "ICE\x0e"; // Thank you Project M // Not sure about GW yet return AlternatesByStage.TryGetValue(key, out value); }