#ifndef POINT_HPP_INCLUDED
#define POINT_HPP_INCLUDED

#include <cstdint>
#include "Box.hpp"

class Box;

class Point
{
    public:
        Point();
        /*!
         * @param X The X-axis coordinate
         * @param Y The Y-axis coordinate
         */
        Point(std::int32_t X, std::int32_t Y);
        Point(const Point& P);

        std::int32_t X; //!< The X-axis coordinate
        std::int32_t Y; //!< The Y-axis coordinate

        double DistanceFrom(const Point& P) const;

        bool InBox(const Box& B) const;

        /*!
         * @param P The center of the circle
         * @param Radius The radius of the circle
         * @return True if this lies within the circle
         */
        bool InCircle(const Point& P, std::int32_t Radius) const;

        bool IsNegative() const; //!< @returns True if either the x-axis or y-axis coordinate are negative
        bool IsPositive() const; //!< @returns True if the x-axis or y-axis coordinates are both positive
        bool OnScreen() const; //!< @returns True if the point is within the client canvas bounds

        bool operator==(const Point& P) const;
        bool operator!=(const Point& P) const;
        Point operator+(const Point& P) const;
        Point operator-(const Point& P) const;
        Point& operator+=(const Point& P);
        Point& operator-=(const Point& P);

        operator bool() const; //!< @returns True if this is not negative @see IsNegative
        friend std::ostream& operator<<(std::ostream& OS, const Point& P);

        ~Point();
};

#endif // POINT_HPP_INCLUDED
