#pragma once
#include <stdint.h>

class asITypeInfo;
class asIScriptObject;
class asIScriptFunction;
class asIScriptContext;

namespace Deer {
    namespace EditorEngine {
        struct DockPanelObject {
        private:
            asITypeInfo* type = nullptr;
            asIScriptObject* object = nullptr;
            asIScriptFunction* renderFunction = nullptr;
            asIScriptFunction* menuBarFunction = nullptr;
            asIScriptFunction* initFunction = nullptr;
            asIScriptContext* scriptContext = nullptr;
            
            bool isValid = false;
            uint32_t flags = 0;

        public:
            DockPanelObject(asITypeInfo*, asIScriptContext*);
            ~DockPanelObject();
            // Delete copy constructor
            DockPanelObject(const DockPanelObject&) = delete;
            DockPanelObject& operator=(const DockPanelObject&) = delete;

            DockPanelObject(DockPanelObject&& other) noexcept;
            DockPanelObject& operator=(DockPanelObject&& other) noexcept;
            
            void setFlag(uint32_t, bool);
            bool getFlag(uint32_t);
            
            void invalidate();
            void init();
            void render();

            // TMP
            int getRefCount();
            
            const char* getName();
        };
    }

    enum DockPannelFlags {
        DockPannelFlag_PannelPadding = 1 << 0,
        DockPannelFlag_ShowPannel = 1 << 1
    };
}