class UI
{
    constructor( engine )
    {
        this.engine = engine;

        this.ui = new Sparrow.UI( this.engine );
        this.engine.addUI( this.ui );

        this.intro = new Intro( this.ui );
        this.gameUI = new GameUI( this.ui );
        this.gameOverUI = new GameOverUI( this.ui );
        this.buildingWindow = new BuildingWindow( this.ui );
    }

    updateGameUI()
    {
        this.gameUI.update();
        this.buildingWindow.update();
    }

    showPopup( str )
    {
        this.gameUI.showPopup( str );
    }

    gameOver( reason )
    {
        this.gameOverUI.show( reason );
        this.buildingWindow.wnd_bg.b_visible = false;
    }

    draw()
    {
        this.ui.draw();
    }
}