#include "system/alloc-entries.h"
+#include "system/baseitem-info.h"
/* The entries in the "race allocator table" */
std::vector<alloc_entry> alloc_race_table;
/* The entries in the "kind allocator table" */
std::vector<alloc_entry> alloc_kind_table;
+
+BaseitemInfo &alloc_entry::get_baseitem() const
+{
+ return baseitems_info[this->index];
+}
* Pass 1 is determined from allocation information
* Pass 2 is determined from allocation restriction
*/
+class BaseitemInfo;
struct alloc_entry {
short index; /* The actual index */
DEPTH level; /* Base dungeon level */
PROB prob1; /* Probability, pass 1 */
PROB prob2; /* Probability, pass 2 */
+
+ BaseitemInfo &get_baseitem() const;
};
extern std::vector<alloc_entry> alloc_race_table;
prob = entry.prob1 * i * BASEITEM_MAX_DEPTH / (entry.level - 1);
}
- const auto &baseitem = baseitems_info[entry.index];
+ const auto &baseitem = entry.get_baseitem();
total[i] += prob / magnificant;
total_frac += prob % magnificant;
break;
}
- const auto &baseitem = baseitems_info[entry.index];
+ const auto &baseitem = entry.get_baseitem();
if ((mode & AM_FORBID_CHEST) && (baseitem.bi_key.tval() == ItemKindType::CHEST)) {
continue;
}