Files
4jcraft/minecraft/java/include/java/Random.h
MatthewBeshay 8f0c2a3f26 refactor: replace Mth with GameMath, switch to stdlib math and std::numbers::pi
Inlined trivial wrappers, moved ranged random methods to Random, replaced M_PI with std::numbers::pi, unified DEGRAD/RAD_TO_GRAD as DEG_TO_RAD, fixed getInt/getDouble default fallback bug, and switched non-worldgen sin/cos to sinf/cosf.
2026-03-31 13:12:34 +11:00

27 lines
598 B
C++

#pragma once
class Random {
private:
int64_t seed;
bool haveNextNextGaussian;
double nextNextGaussian;
protected:
int next(int bits);
public:
Random();
Random(int64_t seed);
void setSeed(int64_t s);
void nextBytes(uint8_t* bytes, unsigned int count);
double nextDouble();
double nextGaussian();
int nextInt();
int nextInt(int to);
int nextInt(int minInclusive, int maxInclusive);
float nextFloat();
float nextFloat(float min, float max);
double nextDouble(double min, double max);
int64_t nextLong();
bool nextBoolean();
};