Class GKRandomDistribution

All Implemented Interfaces:
NSObjectProtocol, GKRandom, ObjCProtocol
Direct Known Subclasses:
GKGaussianDistribution, GKShuffledDistribution

public class GKRandomDistribution
extends NSObject
implements GKRandom
Since:
Available in iOS 9.0 and later.
  • Constructor Details

    • GKRandomDistribution

      public GKRandomDistribution()
    • GKRandomDistribution

      protected GKRandomDistribution​(NSObject.Handle h, long handle)
    • GKRandomDistribution

      protected GKRandomDistribution​(NSObject.SkipInit skipInit)
    • GKRandomDistribution

      public GKRandomDistribution​(GKRandom source, long lowestInclusive, long highestInclusive)
    • GKRandomDistribution

      public GKRandomDistribution​(long lowestInclusive, long highestInclusive)
  • Method Details

    • getLowestValue

      public long getLowestValue()
    • getHighestValue

      public long getHighestValue()
    • getNumberOfPossibleOutcomes

      public long getNumberOfPossibleOutcomes()
    • init

      protected long init​(GKRandom source, long lowestInclusive, long highestInclusive)
    • nextInt

      public long nextInt()
      Specified by:
      nextInt in interface GKRandom
    • nextInt

      public long nextInt​(long upperBound)
      Specified by:
      nextInt in interface GKRandom
    • nextUniform

      public float nextUniform()
      Specified by:
      nextUniform in interface GKRandom
    • nextBool

      public boolean nextBool()
      Specified by:
      nextBool in interface GKRandom
    • create

      protected static long create​(long lowestInclusive, long highestInclusive)
    • die

      public static GKRandomDistribution die​(long sideCount)
    • d6

      public static GKRandomDistribution d6()
    • d20

      public static GKRandomDistribution d20()