#pragma once

class Vector
{
public:
    enum class Primitive
    {
        UNIT_X,
        UNIT_Y,
        UNIT_Z,
        NEGATIVE_X,
        NEGATIVE_Y,
        NEGATIVE_Z
    };

    Vector(Primitive p);

    Vector(double x = 0, double y = 0, double z = 0);

    ~Vector();

    double dotProduct(const Vector& v) const;

    Vector crossProduct(const Vector& v) const;

    void reverseDirection();

    double getX() const;

    double getY() const;

    double getZ() const;

    double getLength() const;

    Vector getNormalized() const;

    void scale(double x, double y = 1.0, double z = 1.0);

    void operator*=(double d)
    {
        mX *= d;
        mY *= d;
        mZ *= d;
    }

    void operator+=(const Vector& vector)
    {
        mX += vector.mX;
        mY += vector.mY;
        mZ += vector.mZ;
    }

    bool operator==(const Vector& rhs) const
    {
        return (mX == rhs.mX)
            && (mY == rhs.mY)
            && (mZ == rhs.mZ);
    }

    bool operator!=(const Vector& rhs) const
    {
        return !operator==(rhs);
    }

private:
    double mX{ 0 };
    double mY{ 0 };
    double mZ{ 0 };
};
