forked from MicrosoftDX/Vorlonjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vorlon.basePlugin.ts
41 lines (35 loc) · 1 KB
/
vorlon.basePlugin.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module VORLON {
export class BasePlugin {
public _ready = true;
protected _id = "";
protected _debug: boolean;
public _type = PluginType.OneOne;
public trace : (msg) => void;
protected traceLog = (msg) => { console.log(msg); };
protected traceNoop = (msg) => { };
public loadingDirectory = "vorlon/plugins";
constructor(public name: string) {
this.debug = Core.debug;
}
public get Type(): PluginType {
return this._type;
}
public get debug(): boolean {
return this._debug;
}
public set debug(val: boolean) {
this._debug = val;
if (val){
this.trace = this.traceLog;
}else{
this.trace = this.traceNoop;
}
}
public getID(): string {
return this._id;
}
public isReady() {
return this._ready;
}
}
}