Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
RandomClass.h
1/* Renegade Scripts.dll
2 Copyright 2013 Tiberian Technologies
3
4 This file is part of the Renegade scripts.dll
5 The Renegade scripts.dll is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free
7 Software Foundation; either version 2, or (at your option) any later
8 version. See the file COPYING for more details.
9 In addition, an exemption is given to allow Run Time Dynamic Linking of this code with any closed source module that does not contain code covered by this licence.
10 Only the source code to the module(s) containing the licenced code has to be released.
11*/
12#ifndef TT_INCLUDE_RANDOMCLASS_H
13#define TT_INCLUDE_RANDOMCLASS_H
14class RandomClass
15{
16 public:
17 RandomClass(unsigned seed=0);
18 operator int(void)
19 {
20 return(operator()());
21 }
22 int operator() (void);
23 int operator() (int minval, int maxval);
24 enum
25 {
26 SIGNIFICANT_BITS=15
27 };
28 protected:
29 unsigned long Seed;
30 enum
31 {
32 MULT_CONSTANT=0x41C64E6D,
33 ADD_CONSTANT=0x00003039,
34 THROW_AWAY_BITS=10
35 };
36};
37#endif