public static SpawnModifier GetMod() { SpawnModifier mod; mods.Get(Probability.SpawnRand, out mod); return(mod); }
public void Test <T>(ProbabilityPool <T> pool, int max, bool print) { System.Random random = new System.Random(); pool.Freshen(); Dictionary <T, int> dict = new Dictionary <T, int>(); for (int i = 0; i < max; i++) { T c = pool.Get(random); int num; if (!dict.TryGetValue(c, out num)) { num = 0; } num++; if (print) { BigBoss.Debug.w(Logs.Main, "Picked " + num + " " + c); } dict[c] = num; } pool.ToLog(Logs.Main); BigBoss.Debug.w(Logs.Main, "Real probability out of " + max); foreach (KeyValuePair <T, int> pair in dict) { BigBoss.Debug.w(Logs.Main, " " + pair.Key + ": " + ((double)pair.Value / max * 100d) + " - " + pair.Value); } }
public static DrawAction <GenSpace> MergeIn <T>(ProbabilityPool <T> elements, System.Random random, Theme theme, GridType type = GridType.Doodad, bool typeOnlyDefault = false, bool themeOnlyDefault = false) where T : ThemeElement { return((arr, x, y) => { MergeIn(arr, x, y, new GenDeploy(elements.Get(random)), theme, type, typeOnlyDefault, themeOnlyDefault); return true; }); }
protected override bool ModifyInternal(RoomSpec spec, double scale) { _amounts.Freshen(); _primitives.Freshen(); byte amount = _amounts.Get(spec.Random); List <BaseRoomMod> mods = _primitives.Get(spec.Random, amount); throw new NotImplementedException(""); return(true); }
public SmartThemeElement Select(System.Random rand) { SmartElement = _pool.Get(rand); return(SmartElement); }
public override bool Get(System.Random random, out T item) { return(_pool.Get(random, out item)); }
public bool Get(System.Random random, out T item, ushort level) { SetFor(level); return(currentPool.Get(random, out item)); }