PureMVC ApplicationFacade类模板

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PureMVC ApplicationFacade类模板相关的知识,希望对你有一定的参考价值。

  1. /**
  2. * Base PureMVC Project
  3. */
  4. package {
  5.  
  6. import org.puremvc.as3.interfaces.IFacade;
  7. import org.puremvc.as3.patterns.facade.Facade;
  8. import controller.*;
  9.  
  10. /**
  11. * Simple ApplicationFacade for PureMVC Structured Project
  12. */
  13.  
  14. public class ApplicationFacade extends Facade implements IFacade {
  15.  
  16. /**
  17. * Notification name constants
  18. */
  19. public static const STARTUP:String = "startup";
  20.  
  21. /**
  22. * Singleton ApplicationFacade Factory Method
  23. */
  24. public static function getInstance(): ApplicationFacade {
  25.  
  26. if (instance == null) {
  27. instance = new ApplicationFacade( );
  28. }
  29. return instance as ApplicationFacade;
  30. }
  31.  
  32. /**
  33. * Broadcast the STARTUP Notification
  34. */
  35. public function startup(app:Object):void {
  36. sendNotification( STARTUP, app );
  37. }
  38.  
  39. /**
  40. * Register Commands with the Controller
  41. */
  42. override protected function initializeController():void
  43. {
  44. super.initializeController();
  45.  
  46. registerCommand(STARTUP, StartupCommand);
  47. }
  48. }
  49. }

以上是关于PureMVC ApplicationFacade类模板的主要内容,如果未能解决你的问题,请参考以下文章

JavaScript的PureMVC框架之Facade类;

[Unity框架]PureMVC

实战 PureMVC

Unity3D架构之PureMVC

Python 中的异步 PureMVC

egret怎么添加puremvc