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.
Since
0.16.0Declaration
Swift
public struct Chance
extension Chance: Equatable
extension Chance: Hashable
extension Chance: ExpressibleByFloatLiteral
extension 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_CACHING
for configuring caching of allCaching
types.Since
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
enableCaching
property. Setting this property overwrites each type’s configuration. This property returnstrue
when every supported type has caching enabled, andfalse
when any supported type has caching disabled.Types that currently support caching:
Since
0.22.0
Declaration
Swift
public var ENABLE_CACHING: Bool { get set }