2026-03-01 12:16:08 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "WeighedRandom.h"
|
|
|
|
|
|
|
|
|
|
class WeighedTreasure : public WeighedRandomItem
|
|
|
|
|
{
|
|
|
|
|
private:
|
2026-03-02 17:37:16 +07:00
|
|
|
shared_ptr<ItemInstance> item;
|
2026-03-01 12:16:08 +08:00
|
|
|
int minCount;
|
|
|
|
|
int maxCount;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
WeighedTreasure(int itemId, int auxValue, int minCount, int maxCount, int weight);
|
2026-03-02 17:37:16 +07:00
|
|
|
WeighedTreasure(shared_ptr<ItemInstance> item, int minCount, int maxCount, int weight);
|
2026-03-01 12:16:08 +08:00
|
|
|
|
2026-03-03 03:04:10 +08:00
|
|
|
static void addChestItems(Random *random, WeighedTreasureArray items, shared_ptr<Container> dest, int numRolls);
|
2026-03-02 17:37:16 +07:00
|
|
|
static void addDispenserItems(Random *random, WeighedTreasureArray items, shared_ptr<DispenserTileEntity> dest, int numRolls);
|
2026-03-01 12:16:08 +08:00
|
|
|
static WeighedTreasureArray addToTreasure(WeighedTreasureArray items, WeighedTreasure *extra);
|
|
|
|
|
};
|