#pragma once

/*
	GameEngine and Editor
	by John Ryland
	Copyright (c) 2023
*/

////////////////////////////////////////////////////////////////////////////////////
//	Terminal View
#include "IView.h"
#include "IApplication.h"
#include "TerminalEmulator.h"

namespace GameEngine {

class TerminalView : public IView
{
public:
    TerminalView(const ApplicationFramework::IApplication& app);
    ~TerminalView() {}

    void Initialize() override;
    void Shutdown() override;
    void Update() override;

    void AddShowMenuItem() override;

private:
    class Emulator : public Terminal::TerminalEmulator
    {
    public:
        Emulator(const ApplicationFramework::IApplication& app);
        void HandleInput() override;
        void Display() override;
        void DrawCursor() override;
        const ApplicationFramework::IApplication&   m_application;
    };

    bool                                        m_open = true;
    Emulator                                    m_emulator;
    const ApplicationFramework::IApplication&   m_application;
};

} // GameEngine namespace
