| 1 | var CCLScripting = function(workerUrl){ |
| 2 | this.version = 1.0; |
| 3 | this.workerUrl = workerUrl; |
| 4 | this.logger = new function(){ |
| 5 | this.log = function(m){ |
| 6 | console.log(m); |
| 7 | }; |
| 8 | this.error = function(m){ |
| 9 | console.error(m); |
| 10 | }; |
| 11 | this.warn = function(m){ |
| 12 | console.warn(m); |
| 13 | }; |
| 14 | }; |
| 15 | this.getWorker = function(){ |
| 16 | return new Worker(this.workerUrl); |
| 17 | }; |
| 18 | this.getScriptingContext = function(stage){ |
| 19 | return new this.ScriptingContext(this, stage); |
| 20 | }; |
| 21 | this.getSandbox = function(stage, player){ |
| 22 | return new this.BridgedSandbox(this, stage, player); |
| 23 | }; |
| 24 | }; |
| 25 | |
| 26 | (function(){ |
| 27 | if(!CCLScripting){ |