base game
This commit is contained in:
26
libs/webpack-interface.js
Normal file
26
libs/webpack-interface.js
Normal file
@@ -0,0 +1,26 @@
|
||||
let wiRes = {}
|
||||
let wiCounter = 0
|
||||
|
||||
class wi {
|
||||
static get res(){ return wiRes }
|
||||
static set res(v){ wiRes = v}
|
||||
static get c(){ return wiCounter }
|
||||
static set c(v){ wiCounter = v }
|
||||
|
||||
static register(fun) {
|
||||
const index = this.c++;
|
||||
this.res[index] = fun;
|
||||
return `wi.call(${index});`
|
||||
}
|
||||
static call(id) {
|
||||
this.res[id]();
|
||||
}
|
||||
static reset(){
|
||||
this.res = {}
|
||||
this.c = 0
|
||||
}
|
||||
static publishFunction(name, fun){
|
||||
window[name] = fun
|
||||
return `${name}`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user