Ejemplo n.º 1
0
                /// <summary>
                /// Generate a random number based on character parameters so the same character will generate the same number every time and get a body based on this number.
                /// </summary>
                internal static BodyData GetRandomBody(ChaControl chaControl)
                {
                    var uncensors = BodyDictionary.Where(x => x.Value.Sex == chaControl.sex && 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 a body based on this number.
                /// </summary>
                internal static BodyData GetRandomBody(ChaControl chaControl)
                {
                    var uncensors = BodyDictionary.Where(x => x.Value.Sex == chaControl.sex && 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]);
                }