Probability
- 
                  
                  
A struct that represents the chance or probability of something happening.
Chances are stored as fractions, and the constructors that take decimal values use some algorithm off of StackOverflow to convert them to fractions.
See moreSince
0.16.0Declaration
Swift
public struct Chanceextension Chance: Equatableextension Chance: Hashableextension Chance: ExpressibleByFloatLiteralextension Chance: Describable - 
                  
                  
An object that caches the results of intensive computations.
In DiceKit, the only cached values are probability computations, which can be very intensive.
The results of rolling are NOT cached.
Implemented By
See
ENABLE_CACHINGfor configuring caching of allCachingtypes.See moreSince
0.22.0Declaration
Swift
public protocol Caching - 
                  
                  
Whether or not DiceKit types should cache the results of probability computations across objects.
The results of rolling are NOT cached.
Every type that supports caching has its own
enableCachingproperty. Setting this property overwrites each type’s configuration. This property returnstruewhen every supported type has caching enabled, andfalsewhen any supported type has caching disabled.Types that currently support caching:
Since
0.22.0
Declaration
Swift
public var ENABLE_CACHING: Bool { get set } 
View on GitHub
        Probability  Reference