Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
928 B

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Generalized 32-bit random number generator
  4. // Range is 0x00000000 - 0x7FFFFFFF
  5. //
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef RANDOM_H
  9. #define RANDOM_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. // the random number seeding is automatic
  14. #define MAX_RANDOM_RANGE 0x7FFFFFFFUL
  15. // restarts random generator
  16. // setting lSeed to 0 causes the current time to be used as the seed
  17. // random number generator will automatically seed itself on first use with current time if this is not called
  18. extern void SeedRandomNumberGenerator(long lSeed = 0);
  19. // returns a random integer of range [low, high]
  20. extern long RandomLong( long lLow, long lHigh );
  21. // returns a random float of range [low, high)
  22. extern float RandomFloat( float flLow, float flHigh );
  23. #endif // RANDOM_H