#pragma once

#include <Bild.h>
#include <Knopf.h>

#include "Chat.h"
#include "Dialog.h"
#include "DragController.h"
#include "ItemList.h"
#include "MapWindow.h"
#include "Menu.h"

class Player;
class InventoryDragSource;

class Game : public Menu
{
private:
    Framework::Knopf* logout;
    Framework::TextFeld* debug;
    Framework::Array<UIMLDialog*> dialogs;
    Framework::UIMLView* guiView;
    Framework::UIMLView* targetUIMLView;
    DragController<InventoryDragSource, int>* inventoryDragController;
    Framework::TextFeld* filter;
    ItemListContainer* itemListContainer;
    Framework::Knopf* chatButton;
    MapWindow* mapWindow;
    Chat* chat;
    bool recipieVisible;

public:
    // Konstruktor
    Game(Bildschirm* zScreen);
    ~Game();

    void updatePosition(Vec3<float> position, bool target, Vec3<int> targetPos);
    void api(char* data);
    void closeCurrentDialog();
    DragController<InventoryDragSource, int>* zInventoryDragController();
    void setTargetUIML(Framework::Text uiml);

    void updateRecipieVisibility();
    void showItemList();
    bool isItemListVisible();
    const Text* zFilterText();
    void makeChatButtonVisible();
    Chat* zChat() const;
    MapWindow* zMap() const;
    void hide() override;
};

class ScreenCenter : public Framework::Zeichnung
{
public:
    ScreenCenter();
    virtual void render(Bild& zRObj) override;
};