home *** CD-ROM | disk | FTP | other *** search
- package ENGINE.CORE
- {
- import flash.utils.getTimer;
-
- public class ORandomInt
- {
-
-
- private var iNextRandom:int;
-
- public function ORandomInt()
- {
- super();
- iNextRandom = getTimer();
- }
-
- public function RandNumber() : Number
- {
- var _loc1_:Number = NaN;
- _loc1_ = Rand();
- return _loc1_ / 32767;
- }
-
- public function Rand() : int
- {
- iNextRandom = iNextRandom * 1103515245 + 12345;
- return iNextRandom >> 16 & 32767;
- }
-
- public function get NextRandom() : int
- {
- return this.iNextRandom;
- }
-
- public function RandOnInterval(param1:Number = 0, param2:Number = 1) : int
- {
- return param1 + Rand() % (1 + param2 - param1);
- }
-
- public function RandVal(param1:int) : int
- {
- var _loc2_:Number = NaN;
- _loc2_ = Rand();
- return _loc2_ % param1;
- }
-
- public function SeedRand(param1:int = 0) : void
- {
- if(param1 == 0)
- {
- iNextRandom = getTimer();
- }
- else
- {
- iNextRandom = param1;
- }
- }
- }
- }
-