Ocular Engine
ARandom.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_MATH_ARANDOM__H__
19 #define __H__OCULAR_MATH_ARANDOM__H__
20 
21 #include <cstdint>
22 
23 //------------------------------------------------------------------------------------------
24 
29 namespace Ocular
30 {
35  namespace Math
36  {
41  namespace Random
42  {
67  class ARandom
68  {
69  public:
70 
71  ARandom();
72  ~ARandom();
73 
77  uint32_t operator()();
78 
82  void seed();
83 
88  virtual void seed(int64_t seed);
89 
93  virtual uint32_t next() = 0;
94 
101  virtual uint32_t next(uint32_t min, uint32_t max);
102 
110  virtual float nextf(float precision = 0.0001f);
111 
120  virtual float nextf(float min, float max, float precision = 0.0001f);
121 
122  virtual int32_t nextSigned();
123 
124  virtual int32_t nextSigned(int32_t min, int32_t max);
125 
129  virtual uint32_t min();
130 
134  virtual uint32_t max();
135 
136  protected:
137 
138  int64_t m_Seed;
139 
140  private:
141  };
142  }
146  }
150 }
155 //------------------------------------------------------------------------------------------
156 
157 #endif
virtual uint32_t next()=0
virtual float nextf(float precision=0.0001f)
Definition: ARandom.cpp:77
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
virtual uint32_t min()
Definition: ARandom.cpp:113
virtual uint32_t max()
Definition: ARandom.cpp:118
void seed()
Definition: ARandom.cpp:52
uint32_t operator()()
Definition: ARandom.cpp:47
Definition: ARandom.hpp:67