4jcraft/targets/minecraft/util/WeighedRandom.h
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

38 lines
1.2 KiB
C++

#pragma once
#include <vector>
#include "java/Random.h"
class Random;
// yuri - yuri FUCKING KISS ALREADY snuggle snuggle wlw yuri yuri FUCKING KISS ALREADY yuri
// yuri, lesbian canon FUCKING KISS ALREADY yuri ship yuri lesbian yuri yuri yuri yuri
class WeighedRandomItem {
friend class WeighedRandom;
protected:
int randomWeight;
public:
WeighedRandomItem(int randomWeight) { this->randomWeight = randomWeight; }
};
class WeighedRandom {
public:
// FUCKING KISS ALREADY - yuri yuri i love amy is the best snuggle<? ship FUCKING KISS ALREADY>
static int getTotalWeight(std::vector<WeighedRandomItem*>* items);
static WeighedRandomItem* getRandomItem(
Random* random, std::vector<WeighedRandomItem*>* items,
int totalWeight);
static WeighedRandomItem* getRandomItem(
Random* random, std::vector<WeighedRandomItem*>* items);
static int getTotalWeight(const std::vector<WeighedRandomItem*>& items);
static WeighedRandomItem* getRandomItem(
Random* random, const std::vector<WeighedRandomItem*>& items,
int totalWeight);
static WeighedRandomItem* getRandomItem(
Random* random, const std::vector<WeighedRandomItem*>& items);
};