示例#1
0
                /// <summary>
                /// Generate a random number based on character parameters so the same character will generate the same number every time and get balls based on this number.
                /// </summary>
                private static BallsData GetRandomBalls(ChaControl chaControl)
                {
                    var uncensors = BallsDictionary.Where(x => x.Value.AllowRandom).Select(x => x.Value).ToArray();

                    if (uncensors.Length == 0)
                    {
                        return(null);
                    }
                    return(uncensors[GetRandomNumber(chaControl, uncensors.Length)]);
                }
                /// <summary>
                /// Generate a random number based on character parameters so the same character will generate the same number every time and get balls based on this number.
                /// </summary>
                internal static BallsData GetRandomBalls(ChaControl chaControl)
                {
                    var uncensors = BallsDictionary.Where(x => x.Value.AllowRandom).Select(x => x.Value).ToArray();

                    if (uncensors.Count() == 0)
                    {
                        return(null);
                    }
                    var randomIndex = new System.Random(chaControl.fileParam.birthDay + chaControl.fileParam.personality + chaControl.fileParam.bloodType).Next(uncensors.Count());

                    return(uncensors[randomIndex]);
                }