Starsector API
Loading...
Searching...
No Matches
com.fs.starfarer.api.util.WeightedRandomPicker< T > Class Template Reference
Inheritance diagram for com.fs.starfarer.api.util.WeightedRandomPicker< T >:
[legend]
Collaboration diagram for com.fs.starfarer.api.util.WeightedRandomPicker< T >:
[legend]

Public Member Functions

WeightedRandomPicker< T > clone ()
 
 WeightedRandomPicker ()
 
 WeightedRandomPicker (boolean ignoreWeights)
 
 WeightedRandomPicker (Random random)
 
void clear ()
 
void addAll (Collection< T > items)
 
void addAll (WeightedRandomPicker< T > other)
 
void add (T item)
 
void add (T item, float weight)
 
void remove (T item)
 
boolean isEmpty ()
 
List< T > getItems ()
 
float getWeight (T item)
 
float getWeight (int index)
 
void setWeight (int index, float weight)
 
getItemWithHighestWeight ()
 
pickAndRemove ()
 
pick (Random random)
 
pick ()
 
Random getRandom ()
 
void setRandom (Random random)
 
void print (String title)
 
float getTotal ()
 

Detailed Description

Definition at line 17 of file WeightedRandomPicker.java.

Constructor & Destructor Documentation

◆ WeightedRandomPicker() [1/3]

◆ WeightedRandomPicker() [2/3]

Definition at line 44 of file WeightedRandomPicker.java.

◆ WeightedRandomPicker() [3/3]

Member Function Documentation

◆ add() [1/2]

Definition at line 103 of file WeightedRandomPicker.java.

◆ add() [2/2]

void com.fs.starfarer.api.util.WeightedRandomPicker< T >.add ( T item,
float weight )

Definition at line 106 of file WeightedRandomPicker.java.

◆ addAll() [1/2]

void com.fs.starfarer.api.util.WeightedRandomPicker< T >.addAll ( Collection< T > items)

Definition at line 91 of file WeightedRandomPicker.java.

◆ addAll() [2/2]

Definition at line 97 of file WeightedRandomPicker.java.

◆ clear()

Definition at line 79 of file WeightedRandomPicker.java.

◆ clone()

◆ getItems()

Definition at line 128 of file WeightedRandomPicker.java.

◆ getItemWithHighestWeight()

T com.fs.starfarer.api.util.WeightedRandomPicker< T >.getItemWithHighestWeight ( )

Definition at line 147 of file WeightedRandomPicker.java.

◆ getRandom()

Definition at line 211 of file WeightedRandomPicker.java.

◆ getTotal()

Definition at line 256 of file WeightedRandomPicker.java.

◆ getWeight() [1/2]

float com.fs.starfarer.api.util.WeightedRandomPicker< T >.getWeight ( int index)

Definition at line 138 of file WeightedRandomPicker.java.

◆ getWeight() [2/2]

float com.fs.starfarer.api.util.WeightedRandomPicker< T >.getWeight ( T item)

Definition at line 132 of file WeightedRandomPicker.java.

◆ isEmpty()

Definition at line 124 of file WeightedRandomPicker.java.

◆ pick() [1/2]

◆ pick() [2/2]

T com.fs.starfarer.api.util.WeightedRandomPicker< T >.pick ( Random random)

Definition at line 171 of file WeightedRandomPicker.java.

◆ pickAndRemove()

Definition at line 165 of file WeightedRandomPicker.java.

◆ print()

void com.fs.starfarer.api.util.WeightedRandomPicker< T >.print ( String title)

Definition at line 221 of file WeightedRandomPicker.java.

◆ remove()

Definition at line 114 of file WeightedRandomPicker.java.

◆ setRandom()

void com.fs.starfarer.api.util.WeightedRandomPicker< T >.setRandom ( Random random)

Definition at line 215 of file WeightedRandomPicker.java.

◆ setWeight()

void com.fs.starfarer.api.util.WeightedRandomPicker< T >.setWeight ( int index,
float weight )

Definition at line 141 of file WeightedRandomPicker.java.


The documentation for this class was generated from the following file: