#ifndef __POSITION_H__
#define __POSITION_H__
#include <vector>

typedef struct position {
        int x;
        int y;

        position();
        position(int nx, int ny);

        position operator+(const position &other) const;
        position &operator=(const position &other);
        position &operator+=(const position &other);
        bool operator==(const position &other) const;
        bool operator!=(const position &other) const;
        bool operator<(const position &other) const;
} position;

typedef std::vector<position> position_list;

std::size_t find(const position_list &sorted_list,
                 const position &target);

// requires: all elements of excluded are in sorted_positions
std::vector<position> remove_from_list(const position_list &sorted_positions,
                                       position_list excluded);
void remove_from_list(position_list &sorted_positions,
                      const position &excluded);

float distance(const position &a, const position &b);
int distance_sqr(const position &a, const position &b);
bool is_adjacent(const position &a, const position &b);

#endif
