public void StarClassIsParsedCorrectly(string starClass, string expectedBaseClass, StarClass.Kind expectedKind) { var entry = (StartJump)JsonConvert.DeserializeObject <JournalEntry>($"{{ \"event\":\"StartJump\", \"StarClass\":\"{starClass}\" }}"); Assert.Equal(starClass, entry.StarClass); var kind = StarClass.GetKind(entry.StarClass, out var baseClass); Assert.Equal(expectedBaseClass, baseClass); Assert.Equal(expectedKind, kind); }
public static Color GetStarClassColor(string starClass) { StarClass.GetKind(starClass, out var baseClass); if (_baseStarClass.TryGetValue(baseClass, out var res)) { return(res); } return(Color.Black); }
public static Color GetStarClassColor(string starClass) { var kind = StarClass.GetKind(starClass, out var baseClass); if (kind != StarClass.Kind.Unknown && _baseStarClass.TryGetValue(baseClass, out var res)) { return(res); } return(Color.Black); }
private static HazardLevel GetHazardLevel(string starClass) { switch (StarClass.GetKind(starClass, out _)) { case StarClass.Kind.MainSequence: return(HazardLevel.Low); case StarClass.Kind.Neutron: case StarClass.Kind.WhiteDwarf: case StarClass.Kind.BlackHole: return(HazardLevel.High); default: return(HazardLevel.Medium); } }