roller

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SrDieSides = 6
View Source
const WodDieSides = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRoll

type BaseRoll []int

func (*BaseRoll) String added in v1.4.0

func (r *BaseRoll) String() (string, error)

func (*BaseRoll) Sum

func (r *BaseRoll) Sum() int

func (*BaseRoll) Value

func (r *BaseRoll) Value() int

type BaseRoller

type BaseRoller struct {
	// contains filtered or unexported fields
}

func NewBaseRoller

func NewBaseRoller() (*BaseRoller, error)

NewBaseRoller creates basic roller with default rng

func NewTestBaseRoller added in v1.4.0

func NewTestBaseRoller(seed1, seed2 uint64) *BaseRoller

NewTestBaseRoller creates basic roller with pinned seed for predictable results for testing

func (*BaseRoller) DoRoll

func (r *BaseRoller) DoRoll(num int, base int) BaseRoll

type Roll

type Roll interface {
	String() string
	Value() int
}

type SrGlitchStatus

type SrGlitchStatus int
const (
	SrNoGlitch SrGlitchStatus = iota
	SrGlitch
	SrCritGlitch
)

func GetGlitchStatus

func GetGlitchStatus(roll ThresholdRoll) SrGlitchStatus

type ThresholdParameters

type ThresholdParameters struct {
	// contains filtered or unexported fields
}

func GetSrParams

func GetSrParams() ThresholdParameters

func NewGetWodRollParams added in v1.2.0

func NewGetWodRollParams(isNineAgain, isEightAgain bool) ThresholdParameters

type ThresholdRoll

type ThresholdRoll struct {
	// contains filtered or unexported fields
}

func (*ThresholdRoll) String added in v1.4.0

func (t *ThresholdRoll) String() (string, error)

func (*ThresholdRoll) Value

func (t *ThresholdRoll) Value() int

type ThresholdRoller

type ThresholdRoller struct {
	// contains filtered or unexported fields
}

func NewThresholdRoller

func NewThresholdRoller() (*ThresholdRoller, error)

func (*ThresholdRoller) DoThresholdRoll

func (t *ThresholdRoller) DoThresholdRoll(count, sides int, params ThresholdParameters) (ThresholdRoll, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL