export default class MainMenuEntry
{
    constructor(title, event)
    {
        this.title = title;
        this.event = event;
    }

    getElement()
    {
        let htmlElement = document.createElement('li');
        htmlElement.innerText = this.title;
        htmlElement.addEventListener(
            'click',
            () => {
                window.dispatchEvent(new this.event());
            }
        );

        return htmlElement;
    }
}