Chance.WeightedEntry

  
Type🔵 Class
Packageio.github.mrtesz.teszcore.util
GitHubChance.java
ExtendsPair<Double, T>

Description

Util class for chance and value, used in Chance#roll.

Chances do not need to sum to 1.0 — entries are rolled relative to each other. e.g. 0.5, 0.3, 0.2 and 5, 3, 2 produce the same distribution.


Constructor

WeightedEntry(double chance, T value);

| Parameter | Type | Annotations | Description | |:———:|:——–:|:———–:|————-| | chance | double | - | Chance | | value | T | - | Value | —

Methods

getChance

double getChance();

Get the chance

Returns: doublechance


getValue

T getValue();

Get the value

Returns: Tvalue



Back to top

Copyright © 2026 Mr_Tesz. All rights reserved

This site uses Just the Docs, a documentation theme for Jekyll.