public float DistFor(Planet p) { foreach (KeyValuePair<Planet, float> pd in this.Planets) { if (p == pd.Key) { return pd.Value; } } return 0f; }