A loot table helper that can be used to randomly pick objects out of a weighted list This design pattern was described in more details by Daniel Cook in 2014 in his blog : https://lostgarden.home.blog/2014/12/08/loot-drop-tables/.
More...
Inherited by MoreMountains.Tools.MMLootTableFloat, MoreMountains.Tools.MMLootTableGameObject, and MoreMountains.Tools.MMLootTableString.
|
virtual void | ComputeWeights () |
| Determines, for each object in the table, its chance percentage, based on the specified weights.
|
virtual T | GetLoot () |
| Returns one object from the table, picked randomly.
|
|
List< T > | ObjectsToLoot |
| the list of objects that have a chance of being returned by the table
|
float | WeightsTotal |
| the total amount of weights, for debug purposes only
|
A loot table helper that can be used to randomly pick objects out of a weighted list This design pattern was described in more details by Daniel Cook in 2014 in his blog : https://lostgarden.home.blog/2014/12/08/loot-drop-tables/.
This generic LootTable defines a list of objects to loot, each of them weighted. The weights don't have to add to a certain number, they're relative to each other. The ComputeWeights method determines, based on these weights, the chance percentage of each object to be picked The GetLoot method returns one object, picked randomly from the table
- Template Parameters
-
◆ ComputeWeights()
virtual void MoreMountains.Tools.MMLootTable< T, V >.ComputeWeights |
( |
| ) |
|
|
virtual |
Determines, for each object in the table, its chance percentage, based on the specified weights.
◆ GetLoot()
virtual T MoreMountains.Tools.MMLootTable< T, V >.GetLoot |
( |
| ) |
|
|
virtual |
Returns one object from the table, picked randomly.
- Returns
◆ _maximumWeightSoFar
float MoreMountains.Tools.MMLootTable< T, V >._maximumWeightSoFar = 0f |
|
protected |
◆ _weightsComputed
bool MoreMountains.Tools.MMLootTable< T, V >._weightsComputed = false |
|
protected |
◆ ObjectsToLoot
List<T> MoreMountains.Tools.MMLootTable< T, V >.ObjectsToLoot |
the list of objects that have a chance of being returned by the table
◆ WeightsTotal
float MoreMountains.Tools.MMLootTable< T, V >.WeightsTotal |
the total amount of weights, for debug purposes only
The documentation for this class was generated from the following file:
- H:/Code/MoreMountains/InventoryEngineStore/Assets/InventoryEngine/MMTools/Foundation/MMLoot/MMLootTable.cs