Guest User

Untitled

a guest
Jan 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. //fasade.asc
  2. // First place that accept incoming RPC from client side.
  3. // ---------------------------------------------------------------------------------
  4. Client.prototype.__resolve = function(ctype) {
  5. // Check if a component class corresponding to ctype exists if so
  6. // return a new facade factory for ctype components
  7. if ( gFrameworkFC.components[ctype] != null )
  8. return this[ctype] = new FCFactory(this, ctype);
  9.  
  10. // else do nothing, forcing a NetConnection.Call.Failed
  11. }
  12.  
  13. // component.asc
  14. // Component inside
  15. // ---------------------------------------------------------------------------------
  16. FCComponent = function( derivedTypeName, derivedType ) {
  17. ..........
  18. derivedType.instances = new Object();
  19.  
  20. // Provide a create method so non-dynamic classes can be created manually
  21. derivedType.create = function(name) { return this.instances[name] = new this(name); }
  22. ..........
  23. gFrameworkFC.registerComponent( derivedTypeName, derivedType );
  24. }
Add Comment
Please, Sign In to add comment