2015-11-14 16:14:13 +01:00
|
|
|
|
|
|
|
const NOTIMPLEMENTED = 'Not implemented.';
|
|
|
|
|
|
|
|
export class Feature {
|
|
|
|
constructor(tf, feature) {
|
|
|
|
this.tf = tf;
|
|
|
|
this.feature = feature;
|
2015-11-15 11:20:40 +01:00
|
|
|
this.enabled = tf[feature];
|
2015-11-14 16:14:13 +01:00
|
|
|
this.config = tf.config();
|
2015-12-27 12:08:14 +01:00
|
|
|
this.emitter = tf.emitter;
|
2015-11-14 16:14:13 +01:00
|
|
|
this.initialized = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
init() {
|
|
|
|
throw new Error(NOTIMPLEMENTED);
|
|
|
|
}
|
|
|
|
|
|
|
|
reset() {
|
|
|
|
this.enable();
|
|
|
|
this.init();
|
|
|
|
}
|
|
|
|
|
|
|
|
destroy() {
|
|
|
|
throw new Error(NOTIMPLEMENTED);
|
|
|
|
}
|
|
|
|
|
|
|
|
enable() {
|
|
|
|
this.enabled = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
disable() {
|
|
|
|
this.enabled = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
isEnabled() {
|
|
|
|
return this.enabled;
|
|
|
|
}
|
|
|
|
}
|