import eventManager from './eventManager.js';
import customEventManager from './customEventManager.js';

export default class eventSystem {
    constructor() {
        this.default = new eventManager();
        this.custom = new customEventManager();
    };
    
    listenForEvent(event, def) {
        if (/minecraft/g.exec(event.split(":")[0])) {
            return this.default.listenForEvent(event.replace(/minecraft:/g, ""), def);
        } else if (/\w+/.exec(event.split(":")[0])) {
            return this.custom.listenForCustomEvent(event, def);
        }
    }
    
    tick(callback, interval) {
        return this.default.tick(callback, interval);
    }
    
}

