a619505d68b7ca40d0b10cb621aa0dfc262efbf4.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. System.register(["__unresolved_0", "cc", "__unresolved_1"], function (_export, _context) {
  2. "use strict";
  3. var _reporterNs, _cclegacy, RandomManager, SeedRandom, _crd;
  4. function _reportPossibleCrUseOfRandomManager(extras) {
  5. _reporterNs.report("RandomManager", "./RandomManager", _context.meta, extras);
  6. }
  7. _export("SeedRandom", void 0);
  8. return {
  9. setters: [function (_unresolved_) {
  10. _reporterNs = _unresolved_;
  11. }, function (_cc) {
  12. _cclegacy = _cc.cclegacy;
  13. }, function (_unresolved_2) {
  14. RandomManager = _unresolved_2.RandomManager;
  15. }],
  16. execute: function () {
  17. _crd = true;
  18. _cclegacy._RF.push({}, "9b02bnNwwZEWq9Ft59BRCIB", "SeedRandom", undefined);
  19. /** 伪随机 */
  20. _export("SeedRandom", SeedRandom = class SeedRandom {
  21. get random() {
  22. return this.rm;
  23. }
  24. constructor(seed) {
  25. this.rm = void 0;
  26. this.sr = void 0;
  27. //@ts-ignore
  28. this.sr = new Math.seedrandom(seed);
  29. this.rm = new (_crd && RandomManager === void 0 ? (_reportPossibleCrUseOfRandomManager({
  30. error: Error()
  31. }), RandomManager) : RandomManager)();
  32. this.rm.setRandom(this.sr);
  33. }
  34. destroy() {
  35. this.rm = null;
  36. this.sr = null;
  37. }
  38. });
  39. _cclegacy._RF.pop();
  40. _crd = false;
  41. }
  42. };
  43. });
  44. //# sourceMappingURL=a619505d68b7ca40d0b10cb621aa0dfc262efbf4.js.map