Chances
public struct Chances
extension Chances: Equatable
extension Chances: Hashable
extension Chances: Describable
A struct that represents the chances of different Rolls happening.
Since
0.16.0-
Creates a new
Chancesobject with no data.Declaration
Swift
public init() -
Creates a new
Chancesobject with the given chances.Parameters
chancesThe rolls and the chances of them occurring.
-
Creates a new
Chancesobject with the given chances.Parameters
chancesThe rolls and the chances of them occurring.
-
Creates a new
Chancesobject with the given chances.Parameters
chancesThe rolls and the chances of them occurring.
-
The chance of the given roll occurring.
This subscript can be used to get or set the chance.
Parameters
rollThe roll to query/set the chance of occurring.
-
A normalized version of this
Chancesinstance. The sum of theChances will be 1Since
0.17.0Declaration
Swift
public var normalized: Chances { get } -
Declaration
Swift
public static func == (lhs: Chances, rhs: Chances) -> Bool -
Declaration
Swift
public func hash(into hasher: inout Hasher) -
Declaration
Swift
public var description: String { get } -
Declaration
Swift
public var debugDescription: String { get }
View on GitHub
Chances Structure Reference