#pragma once

#include "BehaviourScripts/PhysicsObject.hpp"
#include "box2d/box2d.h"
#include <vector>
#include "Vector2.hpp"

namespace TSE
{
    class PhysicsEngine
    {
    private:
        inline static std::vector<PhysicsObject*> registeredObjects = std::vector<PhysicsObject*>();
        inline static b2WorldId worldId = b2WorldId();
        inline static constexpr float timestep = 1.0f / 60.0f;
        inline static const int iterations = 4;
        inline static float elapsedTime = 0;
        
    public:
        static void InitPhysics(Vector2 gravity);
        static void UpdatePhysics();
        static void DeletePhysics();
        static void RegisterPhysicsObject(PhysicsObject* obj);
        static void UnRegisterPhysicsObject(PhysicsObject* obj);
        
        static b2WorldId& GetWorldId();
    };
} // namespace TSE
