public static string NextName() { // Run this first so that if the list of names and the generator have not been created, they will be created now. CreateNameListIfNotExists(); int randomIndex = NumberGenerator.Next(0, names.Count); return(names[randomIndex]); }
string IDesirable.GetRandomDesireReason() { int amountDesireReasons = DesireReasons.Length; if (amountDesireReasons == 0) { return(null); } var randomIndex = NumberGenerator.Next(amountDesireReasons); return(DesireReasons[randomIndex]); }
public Employee(string role) { Name = NameGenerator.NextName(); int Randomizer = NumberGenerator.Next(0, 10); Function = role; if (Function == "Performer") { Boost.StatType = StatTypes.GetByUniqueId("excitement"); } /*else if(Function == "Mechanic") * { * * }*/ else { Exception exception = new Exception("This function does not exist!"); throw exception; } Boost.Multiplier = 1.00f; Boost.Duration = 60; // Extra opdracht if (Randomizer == 0) { Efficiency = 'A'; Salary = 110; Boost.Multiplier += 0.6f; } else if (Randomizer > 0 && Randomizer <= 5) { Efficiency = 'B'; Salary = 100; Boost.Multiplier += 0.35f; } else if (Randomizer > 5) { Efficiency = 'C'; Salary = 90; Boost.Multiplier += 0.2f; } }
private bool shouldGuestEnter() { double nextGuestEnterParkChance = NumberGenerator.NextDouble(); // Lower/increase the chance based on weather nextGuestEnterParkChance *= EntryChanceMultiplier; if (nextGuestEnterParkChance < CHANCE_ENTER_PARK) { return(true); } Debug.WriteLine("Did not let a new guest enter park. It wasn't their day"); Debug.WriteLine(EntryChanceMultiplier); Debug.WriteLine(nextGuestEnterParkChance); Debug.WriteLine("===="); return(false); }
private Guest getNewRandomGuest() { List <Stat> stats = new List <Stat>(); Guest guest = new Guest() { CurrentStats = stats, // Chosen at random bring between 50 and 150 cash into the park Wallet = new Wallet(NumberGenerator.Next((int)MinimumCash, (int)MinimumCash + 70)), }; var statTypes = StatTypes.FindByTarget(GameObjectType.Guest); // When a guest enters, their stats are randomly generated foreach (var statType in statTypes) { stats.Add(new Stat() { Type = statType, Value = statType.GetBaseValue(guest) }); } return(guest); }
// Returns a single random rides and shops by what they serve public BuildableObject GetRandomBuyableObject(ObjectSpecific.Types objectSpecificType) { var objects = GetBuyableObjects(objectSpecificType); return(objects[NumberGenerator.Next(objects.Count)]); }
public GameObject() { CurrentStats = new List <Stat>(); SeedId = NumberGenerator.Next(GameObjects.MaxSeed++); }
public static Weather GetRandom() { int randomIndex = NumberGenerator.Next(0, WeatherTypes.Length); return(WeatherTypes[randomIndex]); }