home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_random.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-01  |  968 b   |  51 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCRandom
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_RANDOM_H
  16. #define _INCLUDE_GS_RANDOM_H
  17.  
  18. #include "gs_object.h"
  19.  
  20. //-------------------------------------------------------------
  21.  
  22. const int gsRANDOM_DEFAULT_SEED = 12345;
  23.  
  24. //-------------------------------------------------------------
  25.  
  26. class gsCRandom : public gsCObject
  27. {
  28.     private:
  29.         int m_seed;
  30.  
  31.         void next();
  32.  
  33.     public:
  34.         gsCRandom();
  35.         ~gsCRandom();
  36.  
  37.         void setSeed(int seed);
  38.  
  39.         float getFloat(float upper_bound);
  40.         float getFloat(float lower_bound,float upper_bound);
  41.  
  42.         int getInt(int upper_bound);
  43.         int getInt(int lower_bound,int upper_bound);
  44.  
  45.         bool getBool();
  46. };
  47.  
  48. //-------------------------------------------------------------
  49.  
  50. #endif
  51.