X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Freverseaction.h;h=267aeaa84bdc11cdec6dcadce0ecc114b4d10782;hb=6b0585c4c6aa12aad13965d5f17be9a4a51653b5;hp=d69af75b16f96e2f76728cb80efd88ecf933325f;hpb=efe42ca948704593c847996d0ae8da71d15bb75b;p=germs.git diff --git a/src/reverseaction.h b/src/reverseaction.h index d69af75..267aeaa 100644 --- a/src/reverseaction.h +++ b/src/reverseaction.h @@ -63,6 +63,14 @@ class ReverseAction : public SortActionImpl{ return false; } + virtual bool operator<(const SortActionImpl& sa) const{ + if (const ReverseAction* psa = dynamic_cast(&sa)){ + if (_i < psa->_i || (_i == psa->_i && _j < psa->_j)) + return true; + } + return false; + } + /** * Gives a string representation of the action, for output */ @@ -71,6 +79,15 @@ class ReverseAction : public SortActionImpl{ os << "[" << _i << "," << _j << "]"; return os.str(); } + + size_t i() const{ + return _i; + } + size_t j() const{ + return _j; + } + + private: size_t _i; size_t _j;