IRandomizer.h 851 B

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef IRR_I_RANDOMIZER_H_INCLUDED
  5. #define IRR_I_RANDOMIZER_H_INCLUDED
  6. #include "IReferenceCounted.h"
  7. namespace irr
  8. {
  9. //! Interface for generating random numbers
  10. class IRandomizer : public virtual IReferenceCounted
  11. {
  12. public:
  13. //! resets the randomizer
  14. /** \param value Initialization value (seed) */
  15. virtual void reset(s32 value=0x0f0f0f0f) =0;
  16. //! generates a pseudo random number in the range 0..randMax()
  17. virtual s32 rand() const =0;
  18. //! generates a pseudo random number in the range 0..1
  19. virtual f32 frand() const =0;
  20. //! get maximum number generated by rand()
  21. virtual s32 randMax() const =0;
  22. };
  23. } // end namespace irr
  24. #endif