Program Listing for File MapLocation.h

Return to documentation for file (necsim/MapLocation.h)

//
// Created by sam on 07/09/19.
//

#ifndef NECSIM_MAPLOCATION_H
#define NECSIM_MAPLOCATION_H
#include <iostream>
namespace necsim
{
    struct MapLocation
    {
        long x;
        long y;
        long xwrap;
        long ywrap;

        MapLocation() : x(0), y(0), xwrap(0), ywrap(0)
        { }

        MapLocation(long x, long y, long xwrap, long ywrap) : x(x), y(y), xwrap(xwrap), ywrap(ywrap)
        { }

        bool isOnGrid() const;

        bool operator==(MapLocation const &m) const;

        bool operator!=(MapLocation const &m) const;

        friend std::ostream &operator<<(std::ostream &os, const MapLocation&m);

        friend std::istream &operator>>(std::istream &is, MapLocation &m);
    };
}
#endif //NECSIM_MAPLOCATION_H