class EventHandler {
    constructor({ eventName, param, func, priority }) {
        this.eventName = eventName;
        this.param = param;
        this.func = func;
        this.priority = priority || 0;
    }

    execute(eventArgs) {
        const args = this.param.map(paramName => eventArgs[paramName]);
        this.func(...args);
    }
}

export { EventHandler };
