#include <cinttypes>
#include <cmath>

#pragma once

namespace ConcreteEngine::Physics {
    struct Vector2;

    struct Vector2Int {
        int32_t x, y;

        Vector2Int(int32_t, int32_t);

        /** Length of this vector squared */
        int32_t SqrMagnitude() const;
        /** Length of this vector */
        float_t Magnitude() const;
        /** This vector with magnitude 1 */
        Vector2 Normalized() const;

        /** Shorthand for Vector2Int(0, 0) */
        static Vector2Int Zero();
        /** Shorthand for Vector2Int(1, 1) */
        static Vector2Int One();
        /** Shorthand for Vector2Int(0, 1) */
        static Vector2Int Up();
        /** Shorthand for Vector2Int(0, -1) */
        static Vector2Int Down();
        /** Shorthand for Vector2Int(-1, 0) */
        static Vector2Int Left();
        /** Shorthand for Vector2Int(1, 0) */
        static Vector2Int Right();

        bool operator==(const Vector2Int&) const;
        bool operator!=(const Vector2Int&) const;
        Vector2Int operator+(const Vector2Int&) const;
        Vector2Int operator-(const Vector2Int&) const;
        Vector2Int operator*(int32_t) const;
        Vector2Int operator/(int32_t) const;
        operator Vector2() const;
    };
}
