public static Pilot GetRandomPilot() { List <int> keyList = new List <int>(pilots.Keys); Pilot randomPilot = pilots[keyList[Rng.Next(keyList.Count)]]; while (true) { if (randomPilot.hasAbility == false) { randomPilot = pilots[keyList[Rng.Next(keyList.Count)]]; } else { break; } } return(randomPilot); }
public UniquePilot(Pilot pilot, int id) { this.pilot = pilot; this.id = id; }