#include <object/camera.hpp>

namespace Game::Object {
    Camera& Camera::getInstance() {
        static Camera instance;
        return instance;
    }

    void Camera::setPosition(float x, float y) {
        std::scoped_lock lock(mMutex);
        mX = x;
        mY = y;
    }

    void Camera::getPosition(float& x, float& y) const {
        std::scoped_lock lock(mMutex);
        x = mX;
        y = mY;
    }

    void Camera::move(float deltaX, float deltaY) {
        std::scoped_lock lock(mMutex);
        mX += deltaX;
        mY += deltaY;
    }
}