private int GetPrevious(Randomizable randomizable) { randomizable.CurrentRandomPos -= randomizable.RandomIncrement; if (randomizable.CurrentRandomPos < 0) { randomizable.CurrentRandomPos += Randomness.Length; } return(Randomness[randomizable.CurrentRandomPos]); }
private int GetNext(Randomizable randomizable) { randomizable.CurrentRandomPos += randomizable.RandomIncrement; if (randomizable.CurrentRandomPos >= Randomness.Length) { randomizable.CurrentRandomPos -= Randomness.Length; } return(Randomness[randomizable.CurrentRandomPos]); }
public int GetPrevInt(Randomizable randomizable, int min, int max) { return(Modulo(GetPrevious(randomizable), max - min) + min); }
public int GetNextInt(Randomizable randomizable, int min, int max) { return(Modulo(GetNext(randomizable), max - min) + min); }
public bool GetPrevBool(Randomizable randomizable) { return(GetPrevious(randomizable) % 2 == 0); }
public bool GetNextBool(Randomizable randomizable) { return(GetNext(randomizable) % 2 == 0); }