MKSystem.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { EncryptUtil } from "../util/EncryptUtil";
  2. import FileUtil from "../util/FileUtil";
  3. import GameUtil from "../util/GameUtil";
  4. import LoadResUtil from "../util/LoadResUtil";
  5. import LogUtil from "../util/LogUtil";
  6. import MathUtil from "../util/MathUtil";
  7. import StorageUtil from "../util/StorageUtil";
  8. import StringUtil from "../util/StringUtil";
  9. import TimeUtil from "../util/TimeUtil";
  10. import HttpSystem from "./HttpSystem";
  11. /**
  12. * @description mk系统
  13. * @author 邹勇,冯聪,薛鸿潇,kaka
  14. */
  15. class MKSystem {
  16. constructor() {
  17. }
  18. /** 工具 */
  19. private _time: TimeUtil;
  20. public get time(): TimeUtil {
  21. return this._time || (this._time = new TimeUtil());
  22. }
  23. private _file: FileUtil;
  24. public get file(): FileUtil {
  25. return this._file || (this._file = new FileUtil());
  26. }
  27. private _encrypt: EncryptUtil;
  28. public get encrypt(): EncryptUtil {
  29. return this._encrypt || (this._encrypt = new EncryptUtil());
  30. }
  31. private _console: LogUtil;
  32. public get console(): LogUtil {
  33. return this._console || (this._console = new LogUtil());
  34. }
  35. private _game: GameUtil;
  36. public get game(): GameUtil {
  37. return this._game || (this._game = new GameUtil());
  38. }
  39. private _loader: LoadResUtil;
  40. public get loader(): LoadResUtil {
  41. return this._loader || (this._loader = new LoadResUtil());
  42. }
  43. private _storage: StorageUtil;
  44. public get storage(): StorageUtil {
  45. return this._storage || (this._storage = new StorageUtil());
  46. }
  47. private _math: MathUtil;
  48. public get math(): MathUtil {
  49. return this._math || (this._math = new MathUtil());
  50. }
  51. private _string: StringUtil;
  52. public get string(): StringUtil {
  53. return this._string || (this._string = new StringUtil());
  54. }
  55. private _http: HttpSystem;
  56. public get http(): HttpSystem {
  57. return this._http || (this._http = new HttpSystem());
  58. }
  59. }
  60. declare global {
  61. /** 牛逼的梦嘉引擎 */
  62. const mk: MKSystem;
  63. }
  64. window['mk'] = new MKSystem();