SpaghettiKart
Loading...
Searching...
No Matches
RandomItemTable Class Reference

#include <RandomItemTable.h>

Collaboration diagram for RandomItemTable:
[legend]

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
 

Detailed Description

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

Constructor & Destructor Documentation

◆ RandomItemTable()

RandomItemTable::RandomItemTable ( )

Member Function Documentation

◆ Add()

bool RandomItemTable::Add ( const std::string & resourceName,
uint32_t rank,
uint32_t weight,
float distance )
Here is the caller graph for this function:

◆ Blacklist()

void RandomItemTable::Blacklist ( const std::string & resourceName)

◆ ClearBlacklist()

void RandomItemTable::ClearBlacklist ( )

◆ IsBlacklisted()

bool RandomItemTable::IsBlacklisted ( uint32_t id) const
Here is the caller graph for this function:

◆ Roll()

uint8_t RandomItemTable::Roll ( uint32_t rank) const
Here is the call graph for this function:

Field Documentation

◆ mBlacklist

std::unordered_set<uint32_t> RandomItemTable::mBlacklist
protected

◆ mDistanceEnabled

bool RandomItemTable::mDistanceEnabled
protected

◆ mTable

std::vector<std::vector<ItemEntry> > RandomItemTable::mTable
protected

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