#pragma once

#include "adapters/il2cpp/Il2CppObjectInstance.h"
#include "external/il2cpp/il2cpp-api-types.h"

namespace ta::adapters::hooks
{
    struct RuntimeCallbacks
    {
        void* context = nullptr;
        void (*application_update)(void* context) noexcept = nullptr;
        void (*gameworld_update)(void* context,
                                 const Il2CppClass* game_world_class,
                                 ta::adapters::il2cpp::Il2CppObjectInstance game_world_instance,
                                 ta::adapters::il2cpp::Il2CppObjectInstance main_player) noexcept = nullptr;
    };

    [[nodiscard]] bool publish_runtime_callbacks(const RuntimeCallbacks& callbacks) noexcept;
    void clear_runtime_callbacks() noexcept;
    void dispatch_application_update() noexcept;
    void dispatch_gameworld_update(const Il2CppClass* game_world_class,
                                   ta::adapters::il2cpp::Il2CppObjectInstance game_world_instance,
                                   ta::adapters::il2cpp::Il2CppObjectInstance main_player) noexcept;
}
