www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

log.js (727B)


      1 function MLog() {
      2     $.extend(this, {
      3         uid: singleton.uid(),
      4         
      5         // Parents
      6         monde: null,
      7         
      8         // Enfants
      9         messages: [],
     10         
     11         // Instanciation
     12         instances: [],
     13         demanderInstance: function() {
     14             var mil = new MInstanceLog();
     15             mil.log = this;
     16             this.instances.push(mil);
     17             return mil;
     18         },
     19         
     20         // Ajout
     21         envoiMessage: function(msg) {
     22             this.messages.push(msg);
     23             faireCallbacks(this.cbMessage, msg);
     24         },
     25         
     26         // Évènements
     27         cbMessage: [],
     28         onMessage: function(callback) {
     29             this.cbMessage.push(callback);
     30         }
     31     });
     32 }