remove global random
This commit is contained in:
parent
31adb6cbc9
commit
96326263a2
@ -1,9 +1,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "utils/Random.hpp"
|
|
||||||
|
|
||||||
struct Vector2;
|
struct Vector2;
|
||||||
struct Color;
|
struct Color;
|
||||||
struct Rectangle;
|
struct Rectangle;
|
||||||
@ -118,6 +117,19 @@ namespace panda
|
|||||||
void concat(Matrix m);
|
void concat(Matrix m);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Random {
|
||||||
|
public:
|
||||||
|
Random(uint64_t seed = 521288629);
|
||||||
|
void SetSeed(uint64_t seed);
|
||||||
|
|
||||||
|
uint64_t Next();
|
||||||
|
double Next_UNI();
|
||||||
|
double Range(double min, double max);
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint64_t s[4];
|
||||||
|
};
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
public:
|
public:
|
||||||
void CreateWindow(int w, int h, const char *str);
|
void CreateWindow(int w, int h, const char *str);
|
||||||
@ -167,9 +179,6 @@ namespace panda
|
|||||||
// ### texture utils
|
// ### texture utils
|
||||||
Rectangle GetTextureRect(const Texture &tex, bool flipX, bool flipY);
|
Rectangle GetTextureRect(const Texture &tex, bool flipX, bool flipY);
|
||||||
|
|
||||||
// Utils
|
|
||||||
Random &GetDefaultRandom();
|
|
||||||
|
|
||||||
// Euclidean Distance
|
// Euclidean Distance
|
||||||
double distance(const Vector2 &p1, const Vector2 &p2);
|
double distance(const Vector2 &p1, const Vector2 &p2);
|
||||||
double distanceSqrt(const Vector2 &p1, const Vector2 &p2);
|
double distanceSqrt(const Vector2 &p1, const Vector2 &p2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user