Skip to content

SelectionChance

Namespace Nfty.Core.Stats in assembly Nfty.Core.

public record SelectionChance

The chance of one roll producing a particular selection, and what that figure is.

Constructors

SelectionChance(double, SpaceCertainty)

public SelectionChance(double Probability, SpaceCertainty Certainty);

Parameters

  • Probability (double) - The probability, 0..1. Zero whenever Certainty is SpaceCertainty.Unknown — a figure that means nothing is not carried as a number that looks like one.
  • Certainty (SpaceCertainty) - SpaceCertainty.Exact when nothing gave up; SpaceCertainty.AtLeast when the rules could not be walked, which makes the figure a floor on the probability and so a CEILING on the odds ("at most 1 in N"); SpaceCertainty.Unknown when the selection could not be mapped onto the book at all. SpaceCertainty.AtMost never occurs here and is not special-cased: see SelectionOdds for why the error can only go one way.

Properties

Certainty

public SpaceCertainty Certainty { get; init; }

SpaceCertainty.Exact when nothing gave up; SpaceCertainty.AtLeast when the rules could not be walked, which makes the figure a floor on the probability and so a CEILING on the odds ("at most 1 in N"); SpaceCertainty.Unknown when the selection could not be mapped onto the book at all. SpaceCertainty.AtMost never occurs here and is not special-cased: see SelectionOdds for why the error can only go one way.

IsExact

public bool IsExact { get; }

Whether SelectionChance.Probability is the real figure rather than a bound.

IsKnown

public bool IsKnown { get; }

Whether there is a figure to show at all.

Nothing

public static SelectionChance Nothing { get; }

Nothing is known about this selection's chance.

OneIn

public double OneIn { get; }

The same figure as odds: one roll in this many. Infinite when nothing is known.

Probability

public double Probability { get; init; }

The probability, 0..1. Zero whenever Certainty is SpaceCertainty.Unknown — a figure that means nothing is not carried as a number that looks like one.