|
SpaghettiKart
|
#include <RandomItemTable.h>
Data Structures | |
| struct | ItemEntry |
Public Member Functions | |
| RandomItemTable () | |
| bool | Add (const std::string &resourceName, uint32_t rank, uint32_t weight, float distance) |
| uint8_t | Roll (uint32_t rank) const |
| void | Blacklist (const std::string &resourceName) |
| bool | IsBlacklisted (uint32_t id) const |
| void | ClearBlacklist () |
Protected Attributes | |
| bool | mDistanceEnabled |
| std::vector< std::vector< ItemEntry > > | mTable |
| std::unordered_set< uint32_t > | mBlacklist |
Uses weighted random picking
This allows stock game to work identically while allowing mods to add items which equalizes the stock items without requiring addition chance editing
| RandomItemTable::RandomItemTable | ( | ) |
| bool RandomItemTable::Add | ( | const std::string & | resourceName, |
| uint32_t | rank, | ||
| uint32_t | weight, | ||
| float | distance ) |
| void RandomItemTable::Blacklist | ( | const std::string & | resourceName | ) |
| void RandomItemTable::ClearBlacklist | ( | ) |
| bool RandomItemTable::IsBlacklisted | ( | uint32_t | id | ) | const |
| uint8_t RandomItemTable::Roll | ( | uint32_t | rank | ) | const |
|
protected |
|
protected |
|
protected |