Delegate.ts 836 B

1234567891011121314151617181920212223242526272829303132333435
  1. /** @format */
  2. export class Delegate {
  3. public mListener: Function
  4. public get listener(): Function {
  5. return this.mListener
  6. }
  7. public mArgArray: any[]
  8. public get argArray(): any[] {
  9. return this.mArgArray
  10. }
  11. public mIsOnce = false
  12. public get isOnce(): boolean {
  13. return this.mIsOnce
  14. }
  15. public set isOnce(isOnce: boolean) {
  16. this.mIsOnce = isOnce
  17. }
  18. public mPriority: number
  19. public set priority(priority: number) {
  20. this.mPriority = priority
  21. }
  22. public get priority(): number {
  23. return this.mPriority
  24. }
  25. public constructor(listener: Function, argArray: any[], isOnce = false, priority = 0) {
  26. this.mListener = listener
  27. this.mArgArray = argArray
  28. this.mIsOnce = isOnce
  29. this.mPriority = priority
  30. }
  31. }