Dice

indigo.shared.dice.Dice
See theDice companion trait
object Dice

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Dice.type

Members list

Type members

Classlikes

object Sides

Pre-constructed dice with a fixed number of sides, rolls are includive and start at 1, not 0. You need to provide a seed value.

Pre-constructed dice with a fixed number of sides, rolls are includive and start at 1, not 0. You need to provide a seed value.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Sides.type

Value members

Concrete methods

def diceSidesN(sides: Int, seedValue: Long): Dice

Constructs a dice with a given number of sides and a seed value.

Constructs a dice with a given number of sides and a seed value.

Attributes

def fromMillis(time: Millis): Dice

Construct a 'max int' sided dice using a time in milliseconds as the seed.

Construct a 'max int' sided dice using a time in milliseconds as the seed.

Attributes

def fromSeconds(time: Seconds): Dice

Construct a 'max int' sided dice using a time in seconds (converted to millis) as the seed.

Construct a 'max int' sided dice using a time in seconds (converted to millis) as the seed.

Attributes

def fromSeed(seed: Long): Dice

Construct a 'max int' sided dice from a given seed value. This is the default dice presented by the FrameContext.

Construct a 'max int' sided dice from a given seed value. This is the default dice presented by the FrameContext.

Attributes

def loaded(fixedTo: Int): Dice

Constructs a 'loaded' dice where everything returns a fixed value. Intended for use during testing.

Constructs a 'loaded' dice where everything returns a fixed value. Intended for use during testing.

Attributes

def rollMany(numberOfDice: Int, sides: Int, seed: Long): Option[NonEmptyList[Int]]

Rolls a number of dice.

Rolls a number of dice.

Value parameters

numberOfDice

How many dice to roll

seed

The seed value to based the dice on

sides

How many sides the dice all have

Attributes

Returns

Returns and Optional NonEmtpyList of Int's, where None is produced when the input values are invalid.