internal static BallsData GetDefaultOrRandomBalls(ChaControl chaControl) { string uncensorKey = DisplayNameToBallsGuid(chaControl.sex == 0 ? DefaultMaleBalls.Value : DefaultFemaleBalls.Value); //None/default balls if (uncensorKey == UncensorKeyNone) { return(null); } //Random if (uncensorKey == UncensorKeyRandom) { return(GetRandomBalls(chaControl)); } //Return the default balls if specified if (BallsDictionary.TryGetValue(uncensorKey, out BallsData defaultBalls)) { return(defaultBalls); } //Something was selected but can no longer be found if (chaControl.sex == 0 && MaleBallsDefaultValue == UncensorKeyNone) { return(null); } if (chaControl.sex == 1 && FemaleBallsDefaultValue == UncensorKeyNone) { return(null); } return(GetRandomBalls(chaControl)); }
internal static BallsData GetDefaultOrRandomBalls(ChaControl chaControl) { string uncensorKey = DisplayNameToBallsGuid(chaControl.sex == 0 ? DefaultMaleBalls.Value : DefaultFemaleBalls.Value); //Return the default balls if specified if (BallsDictionary.TryGetValue(uncensorKey, out BallsData defaultBalls)) { return(defaultBalls); } return(GetRandomBalls(chaControl)); }
internal static BallsData GetDefaultOrRandomBalls(ChaControl chaControl) { string uncensorKey = DisplayNameToBallsGuid(chaControl.sex == 0 ? DefaultMaleBalls.Value : DefaultFemaleBalls.Value); //Return the default balls if specified if (BallsDictionary.TryGetValue(uncensorKey, out BallsData ballsData)) { return(ballsData); } //Get random if none specified ballsData = GetRandomBalls(chaControl); //None available, return the default if (ballsData == null) { BallsDictionary.TryGetValue(DefaultBallsGUID, out ballsData); } return(ballsData); }