home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 150 / MOBICLIC150.ISO / pc / DATA / DSS150 / DSS150_02 / DSS150_02.swf / scripts / dss150_02 / ModuleConfig.as < prev    next >
Text File  |  2012-12-19  |  2KB  |  90 lines

  1. package dss150_02
  2. {
  3.    public class ModuleConfig
  4.    {
  5.        
  6.       
  7.       public var iglooSpeed:Number = 3000;
  8.       
  9.       public var TrouveDelayMS:Number = 2000;
  10.       
  11.       public var levels:Array;
  12.       
  13.       private var listeObject:Object;
  14.       
  15.       public function ModuleConfig(xml:*)
  16.       {
  17.          this.listeObject = {};
  18.          super();
  19.          this.levels = [];
  20.          this.levels.push({
  21.             "no":1,
  22.             "duration":15000,
  23.             "oiseauxMaxNum":1,
  24.             "oiseauxSpeed":80,
  25.             "phoquesMaxNum":0,
  26.             "phoquesSpeed":40
  27.          });
  28.          this.levels.push({
  29.             "no":2,
  30.             "duration":15000,
  31.             "oiseauxMaxNum":2,
  32.             "oiseauxSpeed":80,
  33.             "phoquesMaxNum":0,
  34.             "phoquesSpeed":40
  35.          });
  36.          this.levels.push({
  37.             "no":3,
  38.             "duration":15000,
  39.             "oiseauxMaxNum":2,
  40.             "oiseauxSpeed":70,
  41.             "phoquesMaxNum":0,
  42.             "phoquesSpeed":40
  43.          });
  44.          this.levels.push({
  45.             "no":4,
  46.             "duration":15000,
  47.             "oiseauxMaxNum":2,
  48.             "oiseauxSpeed":70,
  49.             "phoquesMaxNum":1,
  50.             "phoquesSpeed":50
  51.          });
  52.          this.levels.push({
  53.             "no":5,
  54.             "duration":15000,
  55.             "oiseauxMaxNum":2,
  56.             "oiseauxSpeed":70,
  57.             "phoquesMaxNum":1,
  58.             "phoquesSpeed":40
  59.          });
  60.          if(xml != null && xml.length() > 0)
  61.          {
  62.             new ObjectInitializer(this,this.listeObject,xml);
  63.          }
  64.       }
  65.       
  66.       public function toString() : void
  67.       {
  68.          var prop:* = null;
  69.          trace("--- moduleConfig ---");
  70.          for(prop in this.listeObject)
  71.          {
  72.             trace(prop," : ",this[prop]);
  73.          }
  74.          trace("---  ---");
  75.       }
  76.       
  77.       public function toXMLString() : String
  78.       {
  79.          var prop:* = null;
  80.          trace("--- moduleConfig.toXML() ---");
  81.          var xml:String = "<Params>\n";
  82.          for(prop in this.listeObject)
  83.          {
  84.             xml += "\t<Param nom=\"" + prop + "\" valeur=\"" + this[prop] + "\"/>\n";
  85.          }
  86.          return xml + "</Params>";
  87.       }
  88.    }
  89. }
  90.