| ClassPath: | MEng.System.Runtime.RandomNum |
| Parent ClassPath: | MEng.Object |
| Copyable: | No |
| Final: | Yes |
MEng.System.Runtime.RandomNum is used to generate random numbers, as you might expect. Generally you want to generate a random number between zero and some maximum number, so it supports that mode, but of course you can set the maximum value to the maximum Card4 value to effectively not limit the result.
Constructors:
Constructor();
The default constructor is the only one available. Before you use the object, you should call the Seed method to seed the random number generator.
Final, Non-Const Methods:
GetNextVal([In] MEng.Card4 MaxValue) Returns MEng.Card4;
This method will generate a new random number between zero and the passed maximum value (but not including the maximum value.) I.e. it is treated as a modulus value, so you get the remainder of the generated number modulo the passed maximum value.
Seed(In]MEng.Card4 SeedValue);
This method should be called before calling GetNextVal(). It seeds the random number generator. A common way to do this is to pass the value returned from Time.GetCurMillis(), which is random enough to provide a good seeding function.